summaryrefslogtreecommitdiff
path: root/xmake/core/base/table.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/base/table.lua')
-rw-r--r--xmake/core/base/table.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/xmake/core/base/table.lua b/xmake/core/base/table.lua
index c08526c34..7d6717816 100644
--- a/xmake/core/base/table.lua
+++ b/xmake/core/base/table.lua
@@ -335,5 +335,17 @@ function table.imap(arr, mapper)
return newarr
end
+function table.reverse(arr)
+
+ assert(arr)
+
+ local revarr = {}
+ local l = #arr
+ for i = 1, l do
+ revarr[i] = arr[l - i + 1]
+ end
+ return revarr
+end
+
-- return module: table
return table