diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-09-22 04:38:10 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-09-22 04:38:10 +0000 |
commit | 1d288aefee1f72d5a0b56d90eca25aef7f32014f (patch) | |
tree | 8a47a4c90877ca75608cb918269460144be5c2b4 /src/search.c | |
parent | f3e472b0b76a351beec4f6447f17a567103026f0 (diff) | |
download | emacs-1d288aefee1f72d5a0b56d90eca25aef7f32014f.tar.gz |
(REGEXP_CACHE_SIZE): Increase to 20.
(compile_pattern): Check for size match before calling Fstring_equal.
Diffstat (limited to 'src/search.c')
-rw-r--r-- | src/search.c | 8 |
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. */ #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; |