1
0
mirror of https://github.com/natnat-mc/moonbuild synced 2026-05-14 08:01:14 +02:00

min and max were broken, fixed them

This commit is contained in:
Nathan DECHER
2020-09-14 11:28:35 +02:00
parent a125eab22f
commit ccce358155
3 changed files with 57 additions and 41 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ min = (table, cmp=(a, b) -> a<b) ->
val = table[1]
for i=2, #table
elem = table[i]
if cmp val, elem
if cmp elem, val
val = elem
val
@@ -20,7 +20,7 @@ max = (table, cmp=(a, b) -> a<b) ->
val = table[1]
for i=2, #table
elem = table[i]
if not cmp val, elem
if not cmp elem, val
val = elem
val