48,406
edits
No edit summary |
No edit summary |
||
| Line 7: | Line 7: | ||
local get_plaintext = require("Module:utilities").get_plaintext | local get_plaintext = require("Module:utilities").get_plaintext | ||
local match = string.match | local match = string.match | ||
local memoize = require("Module: | local memoize = require("Module:memoize") | ||
local remove = table.remove | local remove = table.remove | ||
local sort = table.sort | local sort = table.sort | ||
| Line 91: | Line 91: | ||
-- begin with the bytes 240 to 244. | -- begin with the bytes 240 to 244. | ||
do | do | ||
-- Memoize match | -- Memoize match with the `simple` flag, which means it should only be used | ||
-- | -- with fixed additional arguments (in this case, the pattern). | ||
local sortkey_match = memoize(match, true) | |||
local | |||
function export.string_sort(item1, item2) | function export.string_sort(item1, item2) | ||
if | if sortkey_match(item1, "^[^\240-\244]*$") and sortkey_match(item2, "^[^\240-\244]*$") then | ||
return item1 < item2 | return item1 < item2 | ||
end | end | ||
| Line 139: | Line 138: | ||
local m_table = require("Module:table") | local m_table = require("Module:table") | ||
local elems = m_table. | local elems = m_table.shallowCopy(args) | ||
local m_languages = require("Module:languages") | local m_languages = require("Module:languages") | ||
local lang | local lang | ||