aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-09-22 04:38:10 +0000
committerRichard M. Stallman1996-09-22 04:38:10 +0000
commit1d288aefee1f72d5a0b56d90eca25aef7f32014f (patch)
tree8a47a4c90877ca75608cb918269460144be5c2b4
parentf3e472b0b76a351beec4f6447f17a567103026f0 (diff)
downloademacs-1d288aefee1f72d5a0b56d90eca25aef7f32014f.tar.gz
emacs-1d288aefee1f72d5a0b56d90eca25aef7f32014f.zip
(REGEXP_CACHE_SIZE): Increase to 20.
(compile_pattern): Check for size match before calling Fstring_equal.
-rw-r--r--src/search.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/search.c b/src/search.c
index 6f4355f5b88..5713e53fd90 100644
--- a/src/search.c
+++ b/src/search.c
@@ -30,11 +30,12 @@ Boston, MA 02111-1307, USA. */
30#include <sys/types.h> 30#include <sys/types.h>
31#include "regex.h" 31#include "regex.h"
32 32
33#define REGEXP_CACHE_SIZE 5 33#define REGEXP_CACHE_SIZE 20
34 34
35/* If the regexp is non-nil, then the buffer contains the compiled form 35/* If the regexp is non-nil, then the buffer contains the compiled form
36 of that regexp, suitable for searching. */ 36 of that regexp, suitable for searching. */
37struct regexp_cache { 37struct regexp_cache
38{
38 struct regexp_cache *next; 39 struct regexp_cache *next;
39 Lisp_Object regexp; 40 Lisp_Object regexp;
40 struct re_pattern_buffer buf; 41 struct re_pattern_buffer buf;
@@ -156,7 +157,8 @@ compile_pattern (pattern, regp, translate, posix)
156 for (cpp = &searchbuf_head; ; cpp = &cp->next) 157 for (cpp = &searchbuf_head; ; cpp = &cp->next)
157 { 158 {
158 cp = *cpp; 159 cp = *cpp;
159 if (!NILP (Fstring_equal (cp->regexp, pattern)) 160 if (XSTRING (cp->regexp)->size == XSTRING (pattern)->size
161 && !NILP (Fstring_equal (cp->regexp, pattern))
160 && cp->buf.translate == translate 162 && cp->buf.translate == translate
161 && cp->posix == posix) 163 && cp->posix == posix)
162 break; 164 break;