mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-26 04:23:44 +01:00
Cache results only if searched 2 times (to avoid silly searches)
This commit is contained in:
parent
c630c90970
commit
d95cdee33d
9
init.lua
9
init.lua
@ -343,8 +343,13 @@ function craftguide:get_filter_items(data, player)
|
|||||||
if not data.items then
|
if not data.items then
|
||||||
data.init_filter_items = filtered_list
|
data.init_filter_items = filtered_list
|
||||||
end
|
end
|
||||||
elseif filter ~= "" and not datas.searches[filter] then
|
elseif filter ~= "" then
|
||||||
datas.searches[filter] = filtered_list
|
-- Cache the results only if searched 2 times
|
||||||
|
if datas.searches[filter] == nil then
|
||||||
|
datas.searches[filter] = false
|
||||||
|
else
|
||||||
|
datas.searches[filter] = filtered_list
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
data.items = filtered_list
|
data.items = filtered_list
|
||||||
|
Loading…
Reference in New Issue
Block a user