diff options
Diffstat (limited to 'fuzzel.lua')
| -rw-r--r-- | fuzzel.lua | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -223,17 +223,17 @@ local function FuzzySort(str, func, ...) --Roughly sort everything by it's distance to the string local usorted = {} + local sorted = {} for k,v in prs(looparg) do local dist = func(str,v) - usorted[dist] = usorted[dist] or {} + if usorted[dist] == nil then + usorted[dist] = {} + tblins(sorted,dist) + end tblins(usorted[dist],v) end --Actually sort them into something can can be iterated with ipairs - local sorted = {} - for k,v in prs(usorted) do - tblins(sorted,k) - end tblsrt(sorted) --Then build our output table |
