Open main menu
Home
Random
Nearby
Log in
Settings
About Kancolle Wiki
Disclaimers
Kancolle Wiki
Search
Changes
← Older edit
Newer edit →
Module:Iterator
(view source)
Revision as of 12:12, 8 October 2017
139 bytes added
,
7 years ago
stable sort? -_-
Line 43:
Line 43:
local sortKey = stringKey('sort', context, n)
local sortKey = stringKey('sort', context, n)
if sortKey then
if sortKey then
−
table.sort(collection, function(a, b) return a[sortKey] < b[sortKey] end)
+
table.sort(collection, function(a, b)
+
if a[sortKey] ~= b[sortKey] then
+
return a[sortKey] < b[sortKey]
+
else
+
return a._id < b._id
+
end
+
end)
end
end
local i = 1
local i = 1
がか
cssedit, gkautomate
7,064
edits