Skip to content

Commit

Permalink
table t in levenshtein function was global, should have been local
Browse files Browse the repository at this point in the history
  • Loading branch information
profan committed Feb 22, 2022
1 parent 15421a5 commit 6d0b8cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bk-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function bk_tree.levenshtein_dist(s1, s2)
if s2:len() == 0 then return s1:len() end
if s1:len() < s2:len() then s1, s2 = s2, s1 end

t = {}
local t = {}
for i=1, #s1+1 do
t[i] = {i-1}
end
Expand Down

0 comments on commit 6d0b8cf

Please sign in to comment.