From 34248d06fdf6d4e7682c658a7ae2b87f8a9db85f Mon Sep 17 00:00:00 2001 From: Tal Einat Date: Sat, 17 May 2014 00:57:48 +0300 Subject: [PATCH] minor comment improvement --- fuzzysearch/memmem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fuzzysearch/memmem.c b/fuzzysearch/memmem.c index 9070984..de6b9e5 100644 --- a/fuzzysearch/memmem.c +++ b/fuzzysearch/memmem.c @@ -78,8 +78,8 @@ void *simple_memmem(const void *haystack, size_t haystacklen, sums_diff -= *((unsigned char *) haystack++); sums_diff += *((unsigned char *) haystack_ptr++); - /* we know that the sums are equal, so it is enough to compare all but - the last characters */ + /* if sums_diff == 0, we know that the sums are equal, so it is enough + to compare all but the last characters */ if (sums_diff == 0 && memcmp(haystack, needle, needlelen-1) == 0) { return (void *) haystack; } @@ -148,8 +148,8 @@ void *simple_memmem_with_needle_sum(const void *haystack, size_t haystacklen, sums_diff -= *((unsigned char *) haystack++); sums_diff += *((unsigned char *) haystack_ptr++); - /* we know that the sums are equal, so it is enough to compare all but - the last characters */ + /* if sums_diff == 0, we know that the sums are equal, so it is enough + to compare all but the last characters */ if (sums_diff == 0 && memcmp(haystack, needle, needlelen-1) == 0) { return (void *) haystack; }