mirror of git://git.sv.gnu.org/nano.git
Refinding the tail of the colors list only when extending,
not for every added color, thus saving some 15 microseconds. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5729 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
f72e16502e
commit
63d59656d3
|
@ -5,6 +5,8 @@
|
|||
these functions, to be more distinguishable.
|
||||
* src/rcfile.c (parse_colors): Reduce the indentation.
|
||||
* src/rcfile.c (parse_colors): Rename a variable.
|
||||
* src/rcfile.c (parse_colors, parse_rcfile): Refind the tail of
|
||||
the colors list only when extending, not for every added color.
|
||||
|
||||
2016-03-11 Benno Schulenberg <bensberg@justemail.net>
|
||||
* src/browser.c (do_browser): Fix compilation when configured with
|
||||
|
|
13
src/rcfile.c
13
src/rcfile.c
|
@ -705,13 +705,8 @@ void parse_colors(char *ptr, bool icase)
|
|||
#endif
|
||||
if (endcolor == NULL)
|
||||
live_syntax->color = newcolor;
|
||||
else {
|
||||
/* Need to recompute endcolor now so we can extend
|
||||
* colors to syntaxes. */
|
||||
for (endcolor = live_syntax->color; endcolor->next != NULL;)
|
||||
endcolor = endcolor->next;
|
||||
else
|
||||
endcolor->next = newcolor;
|
||||
}
|
||||
|
||||
endcolor = newcolor;
|
||||
}
|
||||
|
@ -963,6 +958,12 @@ void parse_rcfile(FILE *rcstream
|
|||
live_syntax = sint;
|
||||
opensyntax = TRUE;
|
||||
|
||||
/* Refind the tail of the color list for this syntax. */
|
||||
endcolor = sint->color;
|
||||
if (endcolor != NULL)
|
||||
while (endcolor->next != NULL)
|
||||
endcolor = endcolor->next;
|
||||
|
||||
keyword = ptr;
|
||||
ptr = parse_next_word(ptr);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue