From 3190d651304965871be13e45d34e84026e687500 Mon Sep 17 00:00:00 2001 From: rxi Date: Thu, 17 Apr 2014 12:07:59 +0100 Subject: [PATCH] Removed use of math.min and math.max in lume.slice() --- lume.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lume.lua b/lume.lua index 26a922a..d9311b7 100644 --- a/lume.lua +++ b/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