From 25e57f6a239a639ecc687df5873128c0d61abfb5 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Mon, 1 Nov 2021 15:43:38 +0100 Subject: [PATCH] Minor cleaning --- etc/common.lua | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/etc/common.lua b/etc/common.lua index 095b1dd..8aaa5d7 100644 --- a/etc/common.lua +++ b/etc/common.lua @@ -449,13 +449,8 @@ local function sort_inventory(player, data) list = compress_items(list, start_i) end - local sorts = {} - - for _, def in ipairs(i3.sorting_methods) do - sorts[def.name] = def.func - end - - local new_inv = sorts[data.sort](list, data) + local idx = get_sorting_idx(data.sort) + local new_inv = i3.sorting_methods[idx].func(list, data) if new_inv then apply_sort(inv, size, data, new_inv, start_i)