aboutsummaryrefslogtreecommitdiff
path: root/builtin/common
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/common')
-rw-r--r--builtin/common/misc_helpers.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/builtin/common/misc_helpers.lua b/builtin/common/misc_helpers.lua
index 88a498927..199f13cd1 100644
--- a/builtin/common/misc_helpers.lua
+++ b/builtin/common/misc_helpers.lua
@@ -575,6 +575,15 @@ function table.insert_all(t, other)
end
+function table.key_value_swap(t)
+ local ti = {}
+ for k,v in pairs(t) do
+ ti[v] = k
+ end
+ return ti
+end
+
+
--------------------------------------------------------------------------------
-- mainmenu only functions
--------------------------------------------------------------------------------