From 44ec0d1ecb56224163c2bdc02b4b46088c4f2601 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Thu, 29 Mar 2012 10:19:42 +0000 Subject: [PATCH] more concise version of Ox.range --- source/Ox/js/Array.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source/Ox/js/Array.js b/source/Ox/js/Array.js index 90b53594..31fcc9cc 100644 --- a/source/Ox/js/Array.js +++ b/source/Ox/js/Array.js @@ -75,12 +75,10 @@ Ox.range Python-style range [-1, -1.5] @*/ Ox.range = function() { - var args = Ox.makeArray(arguments), - arr = []; - args.push(function(i) { + var arr = []; + Ox.loop.apply(null, Ox.merge(Ox.makeArray(arguments), function(i) { arr.push(i); - }); - Ox.loop.apply(null, args); + })); return arr; };