mirror of
git://git.sv.gnu.org/nano.git
synced 2025-01-08 02:32:00 +03:00
tweaks: try the allocation of a multidata cache just once per line
It does not need to be allocated for each multiline regex separately.
This commit is contained in:
parent
bbab9e2e62
commit
21d0755de5
@ -295,13 +295,13 @@ void check_the_multis(linestruct *line)
|
||||
if (openfile->syntax == NULL || openfile->syntax->nmultis == 0)
|
||||
return;
|
||||
|
||||
alloc_multidata_if_needed(line);
|
||||
|
||||
for (ink = openfile->colorstrings; ink != NULL; ink = ink->next) {
|
||||
/* If it's not a multiline regex, skip. */
|
||||
if (ink->end == NULL)
|
||||
continue;
|
||||
|
||||
alloc_multidata_if_needed(line);
|
||||
|
||||
astart = (regexec(ink->start, line->data, 1, &startmatch, 0) == 0);
|
||||
afterstart = line->data + (astart ? startmatch.rm_eo : 0);
|
||||
anend = (regexec(ink->end, afterstart, 1, &endmatch, 0) == 0);
|
||||
|
Loading…
Reference in New Issue
Block a user