Skip to content

Commit

Permalink
Merge pull request #3 from seifferth/master
Browse files Browse the repository at this point in the history
Replace charAt with index notation in levenshtein.coffee
  • Loading branch information
schulzch authored Oct 13, 2019
2 parents 2e8f64b + 927768e commit 0c39456
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/levenshtein.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ levenshtein = (stringA, stringB, insertCb, removeCb, updateCb) ->

for i in [1..a.length] by 1
for j in [1..b.length] by 1
aC = a.charAt(i - 1)
bC = b.charAt(j - 1)
aC = a[i - 1]
bC = b[j - 1]
min = trackedMin(
dist[i - 1][j] + removeCb(aC),
dist[i][j - 1] + insertCb(bC),
Expand Down

0 comments on commit 0c39456

Please sign in to comment.