From ab11da703987cc9cd64953b5f7de175e69605367 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Mon, 8 Feb 2016 17:57:45 +0100 Subject: [PATCH] table size limited to 1000, empty search prettified --- search_frame.lua | 9 +++++++-- test.lua | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/search_frame.lua b/search_frame.lua index 8a92fca..fb4e988 100644 --- a/search_frame.lua +++ b/search_frame.lua @@ -159,6 +159,10 @@ function private.get_form_filter() end function private.prettify_search(search) + if search == '' then + return NORMAL_FONT_COLOR_CODE..'No filter'..FONT_COLOR_CODE_CLOSE + end + local item_pattern = '([^/;]+)([^;]*)/exact' while true do local _, _, name, in_between = strfind(search, item_pattern) @@ -847,8 +851,9 @@ function public.start_search(filter_string) end end, on_read_auction = function(auction_info) --- tinsert(scanned_records, private.create_auction_record(auction_info)) - tinsert(scanned_records, auction_info) + if getn(scanned_records) < 1000 then -- TODO static popup, remove discard + tinsert(scanned_records, auction_info) + end end, on_complete = function() private.results_listing:SetDatabase() diff --git a/test.lua b/test.lua index f143faa..1096b10 100644 --- a/test.lua +++ b/test.lua @@ -21,6 +21,23 @@ function m.key_count(table) return count end +do + + local table = {} + + function m.insert() + for i=1,1000000 do + tinsert(table, i) + end + end + function m.getn() + for i=1,100 do + snipe.log(getn(table)) + end + end + +end + --StaticPopupDialogs["CANCEL_AUCTION"] = { -- text = TEXT(CANCEL_AUCTION_CONFIRMATION), -- button1 = TEXT(ACCEPT),