1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-19 04:21:45 -07:00

(REGEXP_CACHE_SIZE): Increase to 20.

(compile_pattern): Check for size match before calling Fstring_equal.
This commit is contained in:
Richard M. Stallman 1996-09-22 04:38:10 +00:00
parent f3e472b0b7
commit 1d288aefee

View file

@ -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;