diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-10-18 15:14:57 +0300 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-10-18 15:14:57 +0300 |
commit | afb7faa6fadee46a6ab46232eddba2121c77549b (patch) | |
tree | 5d472b568192e15812dbf74c63790abf78ce984b /lib/utils.js | |
parent | 6aa56f92fe07edfc677d390a2e26b37c98da0968 (diff) | |
download | tracifyjs-afb7faa6fadee46a6ab46232eddba2121c77549b.tar.gz tracifyjs-afb7faa6fadee46a6ab46232eddba2121c77549b.zip |
more optimizations for some break/continue cases
Diffstat (limited to 'lib/utils.js')
-rw-r--r-- | lib/utils.js | 6 |
1 files changed, 6 insertions, 0 deletions
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) { |