Add table.key_value_swap (#9248)

This commit is contained in:
HybridDog 2020-01-04 15:44:48 +01:00 committed by Nils Dagsson Moskopp
parent c6c2924273
commit 6a4a4fb737
Signed by: erle
GPG Key ID: A3BC671C35191080
1 changed files with 9 additions and 0 deletions

View File

@ -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
--------------------------------------------------------------------------------