Commit 3709084f authored by Simpy's avatar Simpy 🐹

this is faster?

parent cc539f2a
......@@ -35,10 +35,10 @@ end
--Return short value of a number
function E:ShortValue(v)
local abs_v = (v < 0 and v * -1) or v
for _, style in ipairs(E.ShortPrefixValues) do
if abs_v >= style[1] then
return format(style[2], v / style[1])
local abs_v = v<0 and -v or v
for i=1, #E.ShortPrefixValues do
if abs_v >= E.ShortPrefixValues[i][1] then
return format(E.ShortPrefixValues[i][2], v / E.ShortPrefixValues[i][1])
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment