Skip to content

Commit

Permalink
Avoid a couple of redundant property loads.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeurer committed Mar 11, 2017
1 parent c2ba634 commit 7272ee6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/ember-metal/lib/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,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 @@ -249,8 +250,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 @@ -308,7 +310,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 @@ -475,7 +477,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 7272ee6

Please sign in to comment.