mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Use faster loop to handle prioritize in Base.filter()
This commit is contained in:
parent
3f76bd99ef
commit
34c57a47fa
1 changed files with 3 additions and 3 deletions
|
@ -351,12 +351,12 @@ Base.inject(/** @lends Base# */{
|
||||||
// If there are prioritized keys, process them first.
|
// If there are prioritized keys, process them first.
|
||||||
if (prioritize) {
|
if (prioritize) {
|
||||||
var keys = {};
|
var keys = {};
|
||||||
prioritize.forEach(function(key) {
|
for (var i = 0, key, l = prioritize.length; i < l; i++) {
|
||||||
if (key in source) {
|
if ((key = prioritize[i]) in source) {
|
||||||
handleKey(key);
|
handleKey(key);
|
||||||
keys[key] = true;
|
keys[key] = true;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
// Now reference the processed keys as processed, so that
|
// Now reference the processed keys as processed, so that
|
||||||
// handleKey() will not set them again below.
|
// handleKey() will not set them again below.
|
||||||
processed = keys;
|
processed = keys;
|
||||||
|
|
Loading…
Reference in a new issue