mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-10 05:30:45 -08:00
* search.c (wordify): Omit three unnecessary tests.
This commit is contained in:
parent
1f1d93214d
commit
6f076cc771
2 changed files with 8 additions and 6 deletions
|
|
@ -1,6 +1,7 @@
|
|||
2011-04-03 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* search.c (boyer_moore, wordify): Remove vars set but not used.
|
||||
(wordify): Omit three unnecessary tests.
|
||||
|
||||
* indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
|
||||
All callers changed. This avoids the need for an unused var.
|
||||
|
|
|
|||
13
src/search.c
13
src/search.c
|
|
@ -2105,7 +2105,7 @@ wordify (Lisp_Object string, int lax)
|
|||
if (SYNTAX (c) != Sword)
|
||||
{
|
||||
punct_count++;
|
||||
if (i > 0 && SYNTAX (prev_c) == Sword)
|
||||
if (SYNTAX (prev_c) == Sword)
|
||||
word_count++;
|
||||
}
|
||||
|
||||
|
|
@ -2118,10 +2118,11 @@ wordify (Lisp_Object string, int lax)
|
|||
whitespace_at_end = 0;
|
||||
}
|
||||
else
|
||||
whitespace_at_end = 1;
|
||||
|
||||
if (!word_count)
|
||||
return empty_unibyte_string;
|
||||
{
|
||||
whitespace_at_end = 1;
|
||||
if (!word_count)
|
||||
return empty_unibyte_string;
|
||||
}
|
||||
|
||||
adjust = - punct_count + 5 * (word_count - 1)
|
||||
+ ((lax && !whitespace_at_end) ? 2 : 4);
|
||||
|
|
@ -2149,7 +2150,7 @@ wordify (Lisp_Object string, int lax)
|
|||
memcpy (o, SDATA (string) + i_byte_orig, i_byte - i_byte_orig);
|
||||
o += i_byte - i_byte_orig;
|
||||
}
|
||||
else if (i > 0 && SYNTAX (prev_c) == Sword && --word_count)
|
||||
else if (SYNTAX (prev_c) == Sword && --word_count)
|
||||
{
|
||||
*o++ = '\\';
|
||||
*o++ = 'W';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue