From b48ea2c1a61523fe989a353aab63e65e21767a8d Mon Sep 17 00:00:00 2001 From: George Wort Date: Wed, 30 Jun 2021 14:13:27 +0100 Subject: [PATCH] Remove first check from scanDouble Noodle. Change-Id: I00eabb3cb06ef6a2060df52c26fa8591907a2711 --- src/hwlm/noodle_engine_sve.hpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/hwlm/noodle_engine_sve.hpp b/src/hwlm/noodle_engine_sve.hpp index 3c0931a8..232e0ee0 100644 --- a/src/hwlm/noodle_engine_sve.hpp +++ b/src/hwlm/noodle_engine_sve.hpp @@ -242,17 +242,12 @@ hwlm_error_t scanDouble(const struct noodTable *n, const u8 *buf, size_t len, assert(d < e); assert(d >= buf); - // Check first position in scalar so as to remove underflow possibilities. - size_t matchPos = d - buf; - DEBUG_PRINTF("Test match pos %zu\n", matchPos); - RETURN_IF_TERMINATED(final(n, buf, len, true, cbi, matchPos)); - d += 2; - if (d >= e) { + if (e - d < 2) { return HWLM_SUCCESS; } + ++d; svuint16_t chars = getCharMaskDouble(n, noCase); - // peel off first part to align to the vector size const u8 *d1 = ROUNDUP_PTR(d, svcntb_pat(SV_POW2)); if (d != d1) {