changeset 16275:a4bcfdc9bb66

(REGEXP_CACHE_SIZE): Increase to 20. (compile_pattern): Check for size match before calling Fstring_equal.
author Richard M. Stallman <rms@gnu.org>
date Sun, 22 Sep 1996 04:38:10 +0000
parents e9819849c533
children f98b8c0b6414
files src/search.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/search.c	Sun Sep 22 04:37:55 1996 +0000
+++ b/src/search.c	Sun Sep 22 04:38:10 1996 +0000
@@ -30,11 +30,12 @@
 #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 @@
   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;