mirror of
https://github.com/mt-mods/mail.git
synced 2025-04-30 08:21:44 -04:00
Remove checks and logging from sorters
This commit is contained in:
parent
b784e9599d
commit
811bd3745a
1 changed files with 2 additions and 12 deletions
14
storage.lua
14
storage.lua
|
@ -64,19 +64,9 @@ function mail.sort_messages(messages, sortfield, descending, filter)
|
|||
-- Sorting
|
||||
if sortfield ~= nil then
|
||||
if descending then
|
||||
table.sort(results, function(a, b)
|
||||
if a[sortfield] and b[sortfield] then
|
||||
return a[sortfield] > b[sortfield]
|
||||
end
|
||||
minetest.log("warning", "mail.sort_messages: missing field "..sortfield)
|
||||
end)
|
||||
table.sort(results, function(a, b) return a[sortfield] > b[sortfield] end)
|
||||
else
|
||||
table.sort(results, function(a, b)
|
||||
if a[sortfield] and b[sortfield] then
|
||||
return a[sortfield] < b[sortfield]
|
||||
end
|
||||
minetest.log("warning", "mail.sort_messages: missing field "..sortfield)
|
||||
end)
|
||||
table.sort(results, function(a, b) return a[sortfield] < b[sortfield] end)
|
||||
end
|
||||
end
|
||||
return results
|
||||
|
|
Loading…
Add table
Reference in a new issue