Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid a couple of redundant property loads. #15000

Merged
merged 1 commit into from
Mar 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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