From 3407634aef83ff508b7b95a880d98ef905870b56 Mon Sep 17 00:00:00 2001 From: SX <50966843+S-S-X@users.noreply.github.com> Date: Mon, 10 Apr 2023 13:20:24 +0300 Subject: [PATCH] Remove checks and logging from sorters --- storage.lua | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/storage.lua b/storage.lua index 37c145f..a853299 100644 --- a/storage.lua +++ b/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