From 5995fe8beb75a2f8e4438cdccc7186430953f5ed Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 6 Oct 2024 23:46:59 +0800 Subject: improve hashset.from --- xmake/core/base/hashset.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.3.1