aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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;