Content deleted Content added
faster function, though it's buggy |
fixed |
||
Line 9:
return error(string.format(level, ...), 2)
end
end
function mw.logf(...)
return mw.log(string.format(...))
end
Line 189 ⟶ 193:
increment = function(self, script_code, amount)
self[script_code] = (self[script_code] or 0) + (amount or 1)
-- mw.logf("incremented %s by %d", script_code, amount or 1)
end,
clear = function (self)
Line 222 ⟶ 227:
end
counts:increment(range[3], count)
else -- Codepoint doesn't have data; it's Zzzz.
else▼
-- Get range immediately above codepoint.
local count = 0▼
while
index = index + 1
end
-- mw.logf("range above U+%04X: U+%04X-U+%04X (%s)", codepoint,
-- ranges[index][1], ranges[index][2], ranges[index][3])
▲ local count = 0
local range = ranges[index]
while codepoint < range[1] and codepoint <= block[2]
and not singles[codepoint] do
if codepoint < range[1] then
count = count + 1▼
codepoint = codepoint + 1
▲ count = count + 1
end
counts:increment("Zzzz", count)
end
end
-- mw.logf("U+%04X", codepoint)
end
|