Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
ae4788a8
Commit
ae4788a8
authored
Sep 01, 1995
by
Richard M. Stallman
Browse files
(re_search_2): If pattern starts with \=, optimize search.
parent
aea4a109
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
src/regex.c
src/regex.c
+12
-8
No files found.
src/regex.c
View file @
ae4788a8
...
@@ -3036,7 +3036,7 @@ re_compile_fastmap (bufp)
...
@@ -3036,7 +3036,7 @@ re_compile_fastmap (bufp)
case
at_dot
:
case
at_dot
:
case
after_dot
:
case
after_dot
:
continue
;
continue
;
#endif
/*
not
emacs */
#endif
/* emacs */
case
no_op
:
case
no_op
:
...
@@ -3275,6 +3275,17 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
...
@@ -3275,6 +3275,17 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
range
=
1
;
range
=
1
;
}
}
#ifdef emacs
/* In a forward search for something that starts with \=.
don't keep searching past point. */
if
(
bufp
->
used
>
0
&&
(
re_opcode_t
)
bufp
->
buffer
[
0
]
==
at_dot
&&
range
>
0
)
{
range
=
PT
-
startpos
;
if
(
range
<=
0
)
return
-
1
;
}
#endif
/* emacs */
/* Update the fastmap now if not correct already. */
/* Update the fastmap now if not correct already. */
if
(
fastmap
&&
!
bufp
->
fastmap_accurate
)
if
(
fastmap
&&
!
bufp
->
fastmap_accurate
)
if
(
re_compile_fastmap
(
bufp
)
==
-
2
)
if
(
re_compile_fastmap
(
bufp
)
==
-
2
)
...
@@ -4678,13 +4689,6 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
...
@@ -4678,13 +4689,6 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
if
(
PTR_CHAR_POS
((
unsigned
char
*
)
d
)
<=
point
)
if
(
PTR_CHAR_POS
((
unsigned
char
*
)
d
)
<=
point
)
goto
fail
;
goto
fail
;
break
;
break
;
#if 0 /* not emacs19 */
case at_dot:
DEBUG_PRINT1 ("EXECUTING at_dot.\n");
if (PTR_CHAR_POS ((unsigned char *) d) + 1 != point)
goto fail;
break;
#endif /* not emacs19 */
case
syntaxspec
:
case
syntaxspec
:
DEBUG_PRINT2
(
"EXECUTING syntaxspec %d.
\n
"
,
mcnt
);
DEBUG_PRINT2
(
"EXECUTING syntaxspec %d.
\n
"
,
mcnt
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment