diff options
author | Marius <mariausol@gmail.com> | 2012-10-28 15:00:25 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2012-10-28 15:00:25 +0200 |
commit | 3fcaa5434b428fcc717fbd06822b54ec18194c62 (patch) | |
tree | 020fe87ecadf1865b9358d31a04fcdc37dbdefe4 /tex/context/base/l-table.lua | |
parent | a6994b024b0e60c9d69ddbedc399f0d7a823c70d (diff) | |
download | context-3fcaa5434b428fcc717fbd06822b54ec18194c62.tar.gz |
beta 2012.10.28 13:23
Diffstat (limited to 'tex/context/base/l-table.lua')
-rw-r--r-- | tex/context/base/l-table.lua | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tex/context/base/l-table.lua b/tex/context/base/l-table.lua index 8d18452d2..9d5bf0904 100644 --- a/tex/context/base/l-table.lua +++ b/tex/context/base/l-table.lua @@ -891,25 +891,25 @@ end function table.swapped(t,s) -- hash local n = { } if s then ---~ for i=1,#s do ---~ n[i] = s[i] ---~ end for k, v in next, s do n[k] = v end end ---~ for i=1,#t do ---~ local ti = t[i] -- don't ask but t[i] can be nil ---~ if ti then ---~ n[ti] = i ---~ end ---~ end for k, v in next, t do n[v] = k end return n end +function table.mirror(t) -- hash + local n = { } + for k, v in next, t do + n[v] = k + n[k] = v + end + return n +end + function table.reversed(t) if t then local tt, tn = { }, #t |