This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Remove doubled words
- From: Anssi Hannula <anssi dot hannula at gmail dot com>
- To: Jim Meyering <jim at meyering dot net>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 12 Apr 2011 04:05:04 +0300
- Subject: Re: [PATCH] Remove doubled words
- References: <87vcykj2aq.fsf@rho.meyering.net>
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