From afb7faa6fadee46a6ab46232eddba2121c77549b Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Thu, 18 Oct 2012 15:14:57 +0300 Subject: more optimizations for some break/continue cases --- lib/utils.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/utils.js') diff --git a/lib/utils.js b/lib/utils.js index 79039665..4d3d60f6 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -166,6 +166,12 @@ function string_template(text, props) { }); }; +function remove(array, el) { + for (var i = array.length; --i >= 0;) { + if (array[i] === el) array.splice(i, 1); + } +}; + function mergeSort(array, cmp) { if (array.length < 2) return array.slice(); function merge(a, b) { -- cgit v1.2.3