diff options
| author | ruki <[email protected]> | 2023-10-27 00:47:28 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-10-27 00:47:28 +0800 |
| commit | ab8ceb9f7a8d8faad35d0cf823a7c3395a23eb96 (patch) | |
| tree | 8c24413b48733882e9a638153bd73da52def7506 | |
| parent | 311171bcd0cee217855858b9c94502a40fbfad56 (diff) | |
improve table.unique
| -rw-r--r-- | xmake/core/base/table.lua | 6 | ||||
| -rw-r--r-- | xmake/core/package/package.lua | 10 |
2 files changed, 6 insertions, 10 deletions
diff --git a/xmake/core/base/table.lua b/xmake/core/base/table.lua index 0b368524a..f954596b8 100644 --- a/xmake/core/base/table.lua +++ b/xmake/core/base/table.lua @@ -377,6 +377,9 @@ function table.unique(array, barrier) table.insert(unique, v) end end + if array.__wrap_locked__ then + table.wrap_lock(unique) + end array = unique end end @@ -402,6 +405,9 @@ function table.reverse_unique(array, barrier) table.insert(unique, 1, v) end end + if array.__wrap_locked__ then + table.wrap_lock(unique) + end array = unique end end diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index b9f6e8a06..d9ab55566 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -910,11 +910,6 @@ function _instance:manifest_save() local name = apiname:sub(13) local values = self:get(name) if values ~= nil then - -- we need wrap locked value, e.g. linkgroups = {{"m", "pthread"}} - values = table.wrap(table.clone(values)) - for _, value in ipairs(values) do - table.wrap_unlock(value) - end vars = vars or {} vars[name] = values local extra = self:extraconf(name) @@ -928,11 +923,6 @@ function _instance:manifest_save() if comp then local component_values = comp:get(name) if component_values ~= nil then - -- we need wrap locked value, e.g. linkgroups = {{"m", "pthread"}} - component_values = table.wrap(table.clone(component_values)) - for _, value in ipairs(component_values) do - table.wrap_unlock(value) - end components = components or {} components.vars = components.vars or {} components.vars[component_name] = components.vars[component_name] or {} |
