Commit 1d288aef authored by Richard M. Stallman's avatar Richard M. Stallman

(REGEXP_CACHE_SIZE): Increase to 20.

(compile_pattern): Check for size match before calling Fstring_equal.
parent f3e472b0
......@@ -30,11 +30,12 @@ Boston, MA 02111-1307, USA. */
#include <sys/types.h>
#include "regex.h"
#define REGEXP_CACHE_SIZE 5
#define REGEXP_CACHE_SIZE 20
/* If the regexp is non-nil, then the buffer contains the compiled form
of that regexp, suitable for searching. */
struct regexp_cache {
struct regexp_cache
{
struct regexp_cache *next;
Lisp_Object regexp;
struct re_pattern_buffer buf;
......@@ -156,7 +157,8 @@ compile_pattern (pattern, regp, translate, posix)
for (cpp = &searchbuf_head; ; cpp = &cp->next)
{
cp = *cpp;
if (!NILP (Fstring_equal (cp->regexp, pattern))
if (XSTRING (cp->regexp)->size == XSTRING (pattern)->size
&& !NILP (Fstring_equal (cp->regexp, pattern))
&& cp->buf.translate == translate
&& cp->posix == posix)
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment