Skip to content

Commit

Permalink
Merge pull request #15000 from bmeurer/AvoidRedundantPropertyLoads
Browse files Browse the repository at this point in the history
Avoid a couple of redundant property loads.
  • Loading branch information
rwjblue authored Mar 11, 2017
2 parents c2ba634 + 7272ee6 commit 5ff9fd5
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 5ff9fd5

Please sign in to comment.