From 7f5ce1e6c250d6dfa4a341c68212b3a372c21a00 Mon Sep 17 00:00:00 2001 From: Tobie Langel Date: Fri, 23 Oct 2009 13:17:53 +0200 Subject: [PATCH] Clean-up NWMatcher proxy. --- vendor/nwmatcher/selector_engine.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vendor/nwmatcher/selector_engine.js b/vendor/nwmatcher/selector_engine.js index 4db802c..fea4a02 100644 --- a/vendor/nwmatcher/selector_engine.js +++ b/vendor/nwmatcher/selector_engine.js @@ -8,19 +8,19 @@ delete Prototype._original_nw; Prototype.Selector = (function(NW) { function select(selector, scope) { - var results = []; + var results = [], resultsIndex = 0; NW.select(selector, scope || document, null, function(element) { - results.push(Element.extend(element)); + results[resultsIndex++] = Element.extend(element); }); return results; } function filter(elements, selector) { - var results = [], element; + var results = [], resultsIndex = 0, element; for (var i = 0, length = elements.length; i < length; i++) { element = elements[i]; if (NW.match(element, selector)) { - results.push(Element.extend(element)) + results[resultsIndex++] = Element.extend(element); } } return results;