Skip to content

Commit

Permalink
Merge pull request #16958 from bekzod/remove-clone-models
Browse files Browse the repository at this point in the history
remove redundant `_getModels` in link-to
  • Loading branch information
rwjblue authored Oct 18, 2018
2 parents 0af2af5 + 8f61e8b commit 333a67e
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions packages/@ember/-internals/glimmer/lib/components/link-to.ts
Original file line number Diff line number Diff line change
Expand Up @@ -825,19 +825,6 @@ const LinkComponent = EmberComponent.extend({
return true;
}),

_getModels(params: any[]) {
let modelCount = params.length - 1;
let models = new Array(modelCount);

for (let i = 0; i < modelCount; i++) {
let value = params[i + 1];

models[i] = value;
}

return models;
},

/**
The default href value to use while a link-to is loading.
Only applies when tagName is 'a'
Expand Down Expand Up @@ -888,11 +875,8 @@ const LinkComponent = EmberComponent.extend({
this.set('queryParams', queryParams);

// 4. Any remaining indices (excepting `targetRouteName` at 0) are `models`.
if (params.length > 1) {
this.set('models', this._getModels(params));
} else {
this.set('models', []);
}
params.shift();
this.set('models', params);
},
});

Expand Down

0 comments on commit 333a67e

Please sign in to comment.