diff options
| author | ruki <[email protected]> | 2024-10-06 23:46:59 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-10-06 23:47:05 +0800 |
| commit | 5995fe8beb75a2f8e4438cdccc7186430953f5ed (patch) | |
| tree | 9b10aec20c5c0e3aa30c4ddb031f333032528b59 /xmake/core/base/hashset.lua | |
| parent | 69e854c602c1df0e72c2423fe53340816eff89c3 (diff) | |
improve hashset.from
Diffstat (limited to 'xmake/core/base/hashset.lua')
| -rw-r--r-- | xmake/core/base/hashset.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/core/base/hashset.lua b/xmake/core/base/hashset.lua index ecdfe72fb..5d0ea761e 100644 --- a/xmake/core/base/hashset.lua +++ b/xmake/core/base/hashset.lua @@ -263,7 +263,11 @@ end -- construct from an array function hashset.from(array) - return hashset.of(table.unpack(array)) + local result = hashset.new() + for i = 1, #array do + result:insert(array[i]) + end + return result end -- new hashset |
