summaryrefslogtreecommitdiff
path: root/xmake/rules
diff options
context:
space:
mode:
authorruki <[email protected]>2020-12-04 00:50:55 +0800
committerruki <[email protected]>2020-12-04 00:50:55 +0800
commit45cf48edf8f7859d6469dd783d8ff7d298f7f1c6 (patch)
tree5d7bb4d18bc11e4bfc2c832aa46bf0255c0ac3e2 /xmake/rules
parent153ae307f21b27b00e1d9cfcf26b45749da35d9d (diff)
add table.swap
Diffstat (limited to 'xmake/rules')
-rw-r--r--xmake/rules/utils/inherit_links/inherit_links.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/xmake/rules/utils/inherit_links/inherit_links.lua b/xmake/rules/utils/inherit_links/inherit_links.lua
index cb3be74a9..c6fe6329f 100644
--- a/xmake/rules/utils/inherit_links/inherit_links.lua
+++ b/xmake/rules/utils/inherit_links/inherit_links.lua
@@ -43,8 +43,7 @@ function main(target)
target:add("links", target:basename(), {interface = true})
local links = target:get("links", {rawref = true})
if links and type(links) == "table" and #links > 1 then
- table.insert(links, 1, links[#links])
- table.remove(links, #links)
+ table.swap(links, 1, #links)
end
target:add("linkdirs", path.directory(targetfile), {interface = true})