Skip to content

Commit 00726c3

Browse files
authored
Simplify return
1 parent 5d2706a commit 00726c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Search/RabinKarp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function rabinKarpSearch(text, pattern) {
5050
}
5151
}
5252

53-
return indices.length > 0 ? indices : [] // Return an array of indices where the pattern is found or empty array if not found
53+
return indices
5454
}
5555

5656
function hash(str, length) {

0 commit comments

Comments
 (0)