OSDN Git Service

use loop-local variable in qFindByteArray()
authorIvailo Monev <xakepa10@gmail.com>
Sun, 14 Feb 2021 13:47:22 +0000 (15:47 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 14 Feb 2021 13:47:22 +0000 (15:47 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/tools/qbytearraymatcher.cpp

index 405b874..cbacac6 100644 (file)
@@ -274,8 +274,7 @@ int qFindByteArray(
     const char *end = haystack0 + (l - sl);
     const uint sl_minus_1 = sl - 1;
     uint hashNeedle = 0, hashHaystack = 0;
-    int idx;
-    for (idx = 0; idx < sl; ++idx) {
+    for (int idx = 0; idx < sl; ++idx) {
         hashNeedle = ((hashNeedle<<1) + needle[idx]);
         hashHaystack = ((hashHaystack<<1) + haystack[idx]);
     }