* view.c (is_nroff_sequence): Reordered the statements to gain
a speed-off of 30 percent on a 10 MB file.
Этот коммит содержится в:
родитель
f10fe35005
Коммит
1300633147
@ -1,3 +1,8 @@
|
|||||||
|
2005-06-27 Roland Illig <roland.illig@gmx.de>
|
||||||
|
|
||||||
|
* view.c (is_nroff_sequence): Reordered the statements to gain
|
||||||
|
a speed-off of 30 percent on a 10 MB file.
|
||||||
|
|
||||||
2005-06-22 Pavel Tsekov <ptsekov@gmx.net>
|
2005-06-22 Pavel Tsekov <ptsekov@gmx.net>
|
||||||
|
|
||||||
* main.h: Export edit_one_file.
|
* main.h: Export edit_one_file.
|
||||||
|
21
src/view.c
21
src/view.c
@ -781,16 +781,23 @@ view_ccache_dump (WView *view)
|
|||||||
static gboolean
|
static gboolean
|
||||||
is_nroff_sequence (WView *view, offset_type offset)
|
is_nroff_sequence (WView *view, offset_type offset)
|
||||||
{
|
{
|
||||||
int c0, c1, c2, retval;
|
int c0, c1, c2;
|
||||||
|
|
||||||
|
/* The following commands are ordered to speed up the calculation. */
|
||||||
|
|
||||||
|
c1 = get_byte_indexed (view, offset, 1);
|
||||||
|
if (c1 == -1 || c1 != '\b')
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
c0 = get_byte_indexed (view, offset, 0);
|
c0 = get_byte_indexed (view, offset, 0);
|
||||||
c1 = get_byte_indexed (view, offset, 1);
|
if (c0 == -1 || !is_printable(c0))
|
||||||
c2 = get_byte_indexed (view, offset, 2);
|
return FALSE;
|
||||||
|
|
||||||
retval = (c0 != -1 && c1 != -1 && c2 != -1
|
c2 = get_byte_indexed (view, offset, 2);
|
||||||
&& is_printable (c0) && c1 == '\b' && is_printable (c2)
|
if (c2 == -1 || !is_printable(c2))
|
||||||
&& (c0 == c2 || c0 == '_' || (c0 == '+' && c2 == 'o')));
|
return FALSE;
|
||||||
return retval;
|
|
||||||
|
return (c0 == c2 || c0 == '_' || (c0 == '+' && c2 == 'o'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Look up the missing components of ''coord'', which are given by
|
/* Look up the missing components of ''coord'', which are given by
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user