summaryrefslogtreecommitdiff
path: root/xmake/core/base/hashset.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-10-06 23:46:59 +0800
committerruki <[email protected]>2024-10-06 23:47:05 +0800
commit5995fe8beb75a2f8e4438cdccc7186430953f5ed (patch)
tree9b10aec20c5c0e3aa30c4ddb031f333032528b59 /xmake/core/base/hashset.lua
parent69e854c602c1df0e72c2423fe53340816eff89c3 (diff)
improve hashset.from
Diffstat (limited to 'xmake/core/base/hashset.lua')
-rw-r--r--xmake/core/base/hashset.lua6
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