[PATCH] Remove doubled words
Anssi Hannula
anssi.hannula@gmail.com
Tue Apr 12 01:31:00 GMT 2011
On 11.04.2011 17:22, Jim Meyering wrote:
> I noticed many doubled words in other projects,
> and figured I'd check here, too.
>
> From 414d1e73a4465cb7499beadd2f5b060821b26a05 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering@redhat.com>
> Date: Sun, 10 Apr 2011 22:54:47 +0200
> Subject: [PATCH] Remove doubled words in comments, e.g., s/the the/the/, s/to
> to/to/
[...]
> diff --git a/string/str-two-way.h b/string/str-two-way.h
> index 76044b3..0489f90 100644
> --- a/string/str-two-way.h
> +++ b/string/str-two-way.h
[...]
> @@ -264,7 +264,7 @@ two_way_short_needle (const unsigned char *haystack, size_t haystack_len,
> {
> /* The two halves of needle are distinct; no extra memory is
> required, and any mismatch results in a maximal shift. */
> - period = MAX (suffix, needle_len - suffix) + 1;
> + period = MAX (suffix, needle_len - suffix);
> j = 0;
> while (AVAILABLE (haystack, haystack_len, j, needle_len))
> {
> @@ -387,7 +387,7 @@ two_way_long_needle (const unsigned char *haystack, size_t haystack_len,
> /* The two halves of needle are distinct; no extra memory is
> required, and any mismatch results in a maximal shift. */
> size_t shift;
> - period = MAX (suffix, needle_len - suffix) + 1;
> + period = MAX (suffix, needle_len - suffix);
> j = 0;
> while (AVAILABLE (haystack, haystack_len, j, needle_len))
> {
Those +1 don't seem doubled to me :)
--
Anssi Hannula
More information about the Libc-alpha
mailing list