diff options
| author | Paul Eggert | 2011-04-02 21:21:50 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-02 21:21:50 -0700 |
| commit | 6f076cc771577096ebebb0af50462c6d0a4c112e (patch) | |
| tree | b2c9be63fc09291d4ced9dc3228fe6388fb99d02 /src/search.c | |
| parent | 1f1d93214d8221e0dfe7bf750b29d49b1271b0ca (diff) | |
| download | emacs-6f076cc771577096ebebb0af50462c6d0a4c112e.tar.gz emacs-6f076cc771577096ebebb0af50462c6d0a4c112e.zip | |
* search.c (wordify): Omit three unnecessary tests.
Diffstat (limited to 'src/search.c')
| -rw-r--r-- | src/search.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/search.c b/src/search.c index 4358bf2186a..fa44e1300d7 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -2105,7 +2105,7 @@ wordify (Lisp_Object string, int lax) | |||
| 2105 | if (SYNTAX (c) != Sword) | 2105 | if (SYNTAX (c) != Sword) |
| 2106 | { | 2106 | { |
| 2107 | punct_count++; | 2107 | punct_count++; |
| 2108 | if (i > 0 && SYNTAX (prev_c) == Sword) | 2108 | if (SYNTAX (prev_c) == Sword) |
| 2109 | word_count++; | 2109 | word_count++; |
| 2110 | } | 2110 | } |
| 2111 | 2111 | ||
| @@ -2118,10 +2118,11 @@ wordify (Lisp_Object string, int lax) | |||
| 2118 | whitespace_at_end = 0; | 2118 | whitespace_at_end = 0; |
| 2119 | } | 2119 | } |
| 2120 | else | 2120 | else |
| 2121 | whitespace_at_end = 1; | 2121 | { |
| 2122 | 2122 | whitespace_at_end = 1; | |
| 2123 | if (!word_count) | 2123 | if (!word_count) |
| 2124 | return empty_unibyte_string; | 2124 | return empty_unibyte_string; |
| 2125 | } | ||
| 2125 | 2126 | ||
| 2126 | adjust = - punct_count + 5 * (word_count - 1) | 2127 | adjust = - punct_count + 5 * (word_count - 1) |
| 2127 | + ((lax && !whitespace_at_end) ? 2 : 4); | 2128 | + ((lax && !whitespace_at_end) ? 2 : 4); |
| @@ -2149,7 +2150,7 @@ wordify (Lisp_Object string, int lax) | |||
| 2149 | memcpy (o, SDATA (string) + i_byte_orig, i_byte - i_byte_orig); | 2150 | memcpy (o, SDATA (string) + i_byte_orig, i_byte - i_byte_orig); |
| 2150 | o += i_byte - i_byte_orig; | 2151 | o += i_byte - i_byte_orig; |
| 2151 | } | 2152 | } |
| 2152 | else if (i > 0 && SYNTAX (prev_c) == Sword && --word_count) | 2153 | else if (SYNTAX (prev_c) == Sword && --word_count) |
| 2153 | { | 2154 | { |
| 2154 | *o++ = '\\'; | 2155 | *o++ = '\\'; |
| 2155 | *o++ = 'W'; | 2156 | *o++ = 'W'; |