mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
String comparing fix
This commit is contained in:
parent
201119e05c
commit
b5b0b8413a
2 changed files with 8 additions and 6 deletions
|
@ -118,7 +118,7 @@ function compareString(
|
|||
}
|
||||
|
||||
const currMatchIndex = s2a.indexOf(s1a[i])
|
||||
if (lastMatchIndex < currMatchIndex) {
|
||||
if (currMatchIndex !== -1 && lastMatchIndex < currMatchIndex) {
|
||||
match++
|
||||
lastMatchIndex = currMatchIndex
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue