summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/l-table.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2016-11-01 11:41:49 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-11-01 11:41:49 +0100
commit5a501d72ddc9ab9003746aa46fad3a12046e20ec (patch)
tree961dfe1070db46aa798ec0dc553f19b60f8355c6 /tex/context/base/mkiv/l-table.lua
parentf0bc9c17c5298a3a4645f28a39273f52c27c646a (diff)
downloadcontext-5a501d72ddc9ab9003746aa46fad3a12046e20ec.tar.gz
2016-11-01 10:15:00
Diffstat (limited to 'tex/context/base/mkiv/l-table.lua')
-rw-r--r--tex/context/base/mkiv/l-table.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/l-table.lua b/tex/context/base/mkiv/l-table.lua
index 498f51833..1cf63db0c 100644
--- a/tex/context/base/mkiv/l-table.lua
+++ b/tex/context/base/mkiv/l-table.lua
@@ -1077,7 +1077,7 @@ function table.count(t)
return n
end
-function table.swapped(t,s) -- hash
+function table.swapped(t,s) -- hash, we need to make sure we don't mess up next
local n = { }
if s then
for k, v in next, s do
@@ -1090,7 +1090,14 @@ function table.swapped(t,s) -- hash
return n
end
-function table.mirrored(t) -- hash
+function table.hashed(t) -- list, add hash to index (save because we are not yet mixed
+ for i=1,#t do
+ t[t[i]] = i
+ end
+ return t
+end
+
+function table.mirrored(t) -- hash, we need to make sure we don't mess up next
local n = { }
for k, v in next, t do
n[v] = k