Prototype: fix table.sort failing to compare number keys with string keys
This commit is contained in:
parent
f2af58a653
commit
8080b79b68
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,7 @@ function Prototype:__tostring()
|
|||
-- load and sort table keys
|
||||
local tkeys={}
|
||||
for k in pairs(self) do table.insert(tkeys, k) end
|
||||
table.sort(tkeys)
|
||||
table.sort(tkeys, function(a,b) return tostring(a)<tostring(b) end)
|
||||
-- iterate over our table
|
||||
for _,k in ipairs(tkeys) do
|
||||
local v = Prototype.__tostring(self[k])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue