Skip to content

Commit

Permalink
Avoid a couple of redundant property loads.
Browse files Browse the repository at this point in the history
(cherry picked from commit 7272ee6)
  • Loading branch information
bmeurer authored and chancancode committed Mar 14, 2017
1 parent c104dcd commit 51d039e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/ember-metal/lib/meta.js
Expand Up @@ -212,8 +212,9 @@ export class Meta {
_getInherited(key) {
let pointer = this;
while (pointer !== undefined) {
if (pointer[key]) {
return pointer[key];
let map = pointer[key];
if (map) {
return map;
}
pointer = pointer.parent;
}
Expand Down Expand Up @@ -253,8 +254,9 @@ export class Meta {
if (map) {
let value = map[subkey];
if (value) {
if (value[itemkey] !== undefined) {
return value[itemkey];
let itemvalue = value[itemkey];
if (itemvalue !== undefined) {
return itemvalue;
}
}
}
Expand Down Expand Up @@ -312,7 +314,7 @@ export class Meta {
if (map) {
let value = map[subkey];
if (value !== undefined || subkey in map) {
return map[subkey];
return value;
}
}
pointer = pointer.parent;
Expand Down Expand Up @@ -479,7 +481,7 @@ if (isEnabled('mandatory-setter')) {
if (map) {
let value = map[subkey];
if (value !== undefined || subkey in map) {
return map[subkey];
return value;
}
}
pointer = pointer.parent;
Expand Down

0 comments on commit 51d039e

Please sign in to comment.