summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/sort-ini.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/sort-ini.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/sort-ini.lua29
1 files changed, 7 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/sort-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/sort-ini.lua
index 0916337b197..f90b70be5c9 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/sort-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/sort-ini.lua
@@ -401,10 +401,8 @@ local function basic(a,b) -- trace ea and eb
-- hashed (shared) entries
return 0
end
- local ea = a.split
- local eb = b.split
- local na = #ea
- local nb = #eb
+ local ea, eb = a.split, b.split
+ local na, nb = #ea, #eb
if na == 0 and nb == 0 then
-- simple variant (single word)
local result = 0
@@ -416,8 +414,7 @@ local function basic(a,b) -- trace ea and eb
end
end
if result == 0 then
- local la = #ea.uc
- local lb = #eb.uc
+ local la, lb = #ea.uc, #eb.uc
if la > lb then
return 1
elseif lb > la then
@@ -432,8 +429,7 @@ local function basic(a,b) -- trace ea and eb
-- complex variant, used in register (multiple words)
local result = 0
for i=1,nb < na and nb or na do
- local eai = ea[i]
- local ebi = eb[i]
+ local eai, ebi = ea[i], eb[i]
for j=1,#sequence do
local m = sequence[j]
result = basicsort(eai[m],ebi[m])
@@ -442,8 +438,7 @@ local function basic(a,b) -- trace ea and eb
end
end
if result == 0 then
- local la = #eai.uc
- local lb = #ebi.uc
+ local la, lb = #eai.uc, #ebi.uc
if la > lb then
return 1
elseif lb > la then
@@ -591,18 +586,8 @@ function splitters.utf(str,checked) -- we could append m and u but this is clean
-- end
-- end
end
- local m_case = { }
- local z_case = { }
- local p_case = { }
- local m_mapping = { }
- local z_mapping = { }
- local p_mapping = { }
- local char = { }
- local byte = { }
- local n = 0
- local nm = 0
- local nz = 0
- local np = 0
+ local m_case, z_case, p_case, m_mapping, z_mapping, p_mapping, char, byte, n = { }, { }, { }, { }, { }, { }, { }, { }, 0
+ local nm, nz, np = 0, 0, 0
for sc in utfcharacters(str) do
local b = utfbyte(sc)
if b >= digitsoffset then