From 34c57a47fa62f1fc70ec1feaa699cd3638dc252e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 26 Jul 2016 10:20:30 +0200 Subject: [PATCH] Use faster loop to handle prioritize in Base.filter() --- src/core/Base.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/Base.js b/src/core/Base.js index f950a83c..fa2a233d 100644 --- a/src/core/Base.js +++ b/src/core/Base.js @@ -351,12 +351,12 @@ Base.inject(/** @lends Base# */{ // If there are prioritized keys, process them first. if (prioritize) { var keys = {}; - prioritize.forEach(function(key) { - if (key in source) { + for (var i = 0, key, l = prioritize.length; i < l; i++) { + if ((key = prioritize[i]) in source) { handleKey(key); keys[key] = true; } - }); + } // Now reference the processed keys as processed, so that // handleKey() will not set them again below. processed = keys;