From bc1d66b92b6a6a230d61adefe5bf2884ad6a2296 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Mon, 7 Nov 2016 12:29:55 +0100 Subject: [PATCH] greent refactoring --- tabs/post/core.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tabs/post/core.lua b/tabs/post/core.lua index c9d0e1b..3b6f3d8 100644 --- a/tabs/post/core.lua +++ b/tabs/post/core.lua @@ -100,10 +100,12 @@ end function update_inventory_listing() if not ACTIVE then return end - item_listing.populate(inventory_listing, values(filter(copy(inventory_records), function(record) - local settings = read_settings(record.key) - return record.aux_quantity > 0 and (not settings.hidden or show_hidden_checkbox:GetChecked()) - end))) + local records = values(filter(copy(inventory_records), function(record) + local settings = read_settings(record.key) + return record.aux_quantity > 0 and (not settings.hidden or show_hidden_checkbox:GetChecked()) + end)) + sort(records, function(a, b) return a.name < b.name end) + item_listing.populate(inventory_listing, records) end function update_auction_listing() @@ -441,7 +443,6 @@ function update_inventory_records() end release(inventory_records) inventory_records = values(auctionable_map) - sort(inventory_records, function(a, b) return a.name < b.name end) refresh = true end