mirror of
https://github.com/TangentFoxy/lume.git
synced 2024-11-19 07:04:24 +00:00
Removed use of math.min and math.max in lume.slice()
This commit is contained in:
parent
c7471b32fb
commit
3190d65130
6
lume.lua
6
lume.lua
@ -19,8 +19,6 @@ local math_cos = math.cos
|
||||
local math_atan2 = math.atan2
|
||||
local math_sqrt = math.sqrt
|
||||
local math_abs = math.abs
|
||||
local math_min = math.min
|
||||
local math_max = math.max
|
||||
local math_pi = math.pi
|
||||
|
||||
local patternescape = function(str)
|
||||
@ -226,8 +224,8 @@ function lume.slice(t, i, j)
|
||||
i = i and absindex(#t, i) or 1
|
||||
j = j and absindex(#t, j) or #t
|
||||
local rtn = {}
|
||||
for i = math_max(i, 1), math_min(j, #t) do
|
||||
rtn[#rtn + 1] = t[i]
|
||||
for x = i < 1 and 1 or i, j > #t and #t or j do
|
||||
rtn[#rtn + 1] = t[x]
|
||||
end
|
||||
return rtn
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user