aboutsummaryrefslogtreecommitdiff
path: root/utils.lua
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-12-30 14:31:07 -0800
committerBruce Hill <bitbucket@bruce-hill.com>2017-12-30 14:31:07 -0800
commit4789892824237dfb45d5f1cfb3442bfede34eeac (patch)
tree32a32f66263f20d4b65ed8dbef8e0ee733366214 /utils.lua
parent21a6314e270344e6923bb4f0a06fd09b0d9ae581 (diff)
Got everything mostly working.
Diffstat (limited to 'utils.lua')
-rw-r--r--utils.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils.lua b/utils.lua
index bab635d..6e4bfc2 100644
--- a/utils.lua
+++ b/utils.lua
@@ -190,7 +190,8 @@ local function min(list, keyFn)
return keyTable[k]
end
end
- local best, bestKey = list[1], keyFn(best)
+ local best = list[1]
+ local bestKey = keyFn(best)
for i = 2, #list do
local key = keyFn(list[i])
if key < bestKey then
@@ -212,7 +213,8 @@ local function max(list, keyFn)
return keyTable[k]
end
end
- local best, bestKey = list[1], keyFn(best)
+ local best = list[1]
+ local bestKey = keyFn(best)
for i = 2, #list do
local key = keyFn(list[i])
if key > bestKey then