diff options
Diffstat (limited to 'xmake/core/base/hashset.lua')
| -rw-r--r-- | xmake/core/base/hashset.lua | 10 |
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 |
