diff options
| author | ruki <[email protected]> | 2026-08-15 14:37:50 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-08-15 14:37:50 +0800 |
| commit | 57be1de09f2a890e9fff49560ce2665a38e53abb (patch) | |
| tree | e5e5a2ce3144e8dcd8deb7a19420fcbdcec73c33 | |
| parent | efd08c1a30af9d37e333e8205b0fae17a2706100 (diff) | |
improve quick search cache
| -rw-r--r-- | xmake/modules/private/xrepo/quick_search/cache.lua | 4 |
1 files changed, 3 insertions, 1 deletions
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 |
