Use faster loop to handle prioritize in Base.filter()

This commit is contained in:
Jürg Lehni 2016-07-26 10:20:30 +02:00
parent 3f76bd99ef
commit 34c57a47fa

View file

@ -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;