From 3817c0efa745cb15719ce303b41bb2e728c58d32 Mon Sep 17 00:00:00 2001 From: Amos Bird Date: Fri, 4 Sep 2020 02:13:57 +0800 Subject: [PATCH] Remove redundant conditions --- src/Common/StringSearcher.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Common/StringSearcher.h b/src/Common/StringSearcher.h index 13ed67eac93..a4da499837b 100644 --- a/src/Common/StringSearcher.h +++ b/src/Common/StringSearcher.h @@ -254,7 +254,7 @@ public: const auto offset = __builtin_ctz(mask); haystack += offset; - if (haystack < haystack_end && haystack + n <= haystack_end && pageSafe(haystack)) + if (haystack + n <= haystack_end && pageSafe(haystack)) { const auto v_haystack_offset = _mm_loadu_si128(reinterpret_cast(haystack)); const auto v_against_l_offset = _mm_cmpeq_epi8(v_haystack_offset, cachel); @@ -463,7 +463,7 @@ public: const auto offset = __builtin_ctz(mask); haystack += offset; - if (haystack < haystack_end && haystack + n <= haystack_end && pageSafe(haystack)) + if (haystack + n <= haystack_end && pageSafe(haystack)) { const auto v_haystack_offset = _mm_loadu_si128(reinterpret_cast(haystack)); const auto v_against_l_offset = _mm_cmpeq_epi8(v_haystack_offset, cachel); @@ -652,7 +652,7 @@ public: const auto offset = __builtin_ctz(mask); haystack += offset; - if (haystack < haystack_end && haystack + n <= haystack_end && pageSafe(haystack)) + if (haystack + n <= haystack_end && pageSafe(haystack)) { /// check for first 16 octets const auto v_haystack_offset = _mm_loadu_si128(reinterpret_cast(haystack));