summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
authorruki <[email protected]>2026-04-15 22:45:17 +0800
committerruki <[email protected]>2026-04-15 22:45:17 +0800
commitbf5af4c886923bc2ce7cad3816d5f3cb71e770e3 (patch)
treedd7456ec5a1a24044f32a74f7fcce3d107d9a1c6 /xmake
parent6ad31905e758291a955b45cb7b95531d0f23955f (diff)
fix review issuespairs
Diffstat (limited to 'xmake')
-rw-r--r--xmake/core/base/hashset.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/xmake/core/base/hashset.lua b/xmake/core/base/hashset.lua
index 0214fb7f2..405a23474 100644
--- a/xmake/core/base/hashset.lua
+++ b/xmake/core/base/hashset.lua
@@ -189,17 +189,17 @@ end
-- @endcode
--
function hashset:keys()
- -- see hashset:items() for rationale
+ -- see hashset:items() for the stateful-closure rationale and the
+ -- `_NIL` skipping behavior.
local data = self._DATA
local k = nil
return function ()
- k = next(data, k)
+ repeat
+ k = next(data, k)
+ until k ~= hashset._NIL
if k == nil then
return nil
end
- if k == hashset._NIL then
- return k, nil
- end
return k, k
end
end