From 57be1de09f2a890e9fff49560ce2665a38e53abb Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 15 Aug 2026 14:37:50 +0800 Subject: improve quick search cache --- xmake/modules/private/xrepo/quick_search/cache.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xmake/modules/private/xrepo/quick_search/cache.lua b/xmake/modules/private/xrepo/quick_search/cache.lua index 43af417a8..a6d849341 100644 --- a/xmake/modules/private/xrepo/quick_search/cache.lua +++ b/xmake/modules/private/xrepo/quick_search/cache.lua @@ -105,7 +105,9 @@ function find(name, opt) _init() opt = opt or {} local list_result = {} - for cachekey, packagedata in pairs(cache:data()) do + -- @note we need to iterate them in a deterministic order, the caller may just take + -- the results as they come, e.g. the completion candidates + for cachekey, packagedata in table.orderpairs(cache:data()) do -- we only search the packages with the given kind, e.g. nil (package), "addon" local packagename = packagedata.name or cachekey if packagedata.kind == opt.kind then -- cgit v1.3.1