Skip to content

Commit 76cfe8f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 26fbe01 commit 76cfe8f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

strings/rabin_karp.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ def rabin_karp_multiple(
168168
# Check if current hash matches any pattern hash
169169
for pattern, pattern_hash in pattern_hashes.items():
170170
# Verify to avoid spurious hits
171-
if text_hash == pattern_hash and text[i : i + pattern_length] == pattern:
171+
if (
172+
text_hash == pattern_hash
173+
and text[i : i + pattern_length] == pattern
174+
):
172175
results[pattern].append(i)
173176

174177
# Calculate hash for next window

0 commit comments

Comments
 (0)