Skip to content
Permalink
Browse files

perf(ivy): read selected index only when need in prop bindings (#32212)

PR Close #32212
  • Loading branch information...
pkozlowski-opensource authored and AndrewKushnir committed Aug 19, 2019
1 parent 1062960 commit 53f33c1ceccdcfae31ce8807eec7aecf17f4f97b
Showing with 1 addition and 4 deletions.
  1. +1 −4 packages/core/src/render3/instructions/property.ts
@@ -5,7 +5,6 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {assertNotEqual} from '../../util/assert';
import {bindingUpdated} from '../bindings';
import {SanitizerFn} from '../interfaces/sanitization';
import {BINDING_INDEX, LView} from '../interfaces/view';
@@ -35,12 +34,10 @@ import {TsickleIssue1009, elementPropertyInternal, storeBindingMetadata} from '.
*/
export function ɵɵproperty<T>(
propName: string, value: T, sanitizer?: SanitizerFn | null): TsickleIssue1009 {
const index = getSelectedIndex();
ngDevMode && assertNotEqual(index, -1, 'selected index cannot be -1');
const lView = getLView();
const bindReconciledValue = bind(lView, value);
if (bindReconciledValue !== NO_CHANGE) {
elementPropertyInternal(index, propName, bindReconciledValue, sanitizer);
elementPropertyInternal(getSelectedIndex(), propName, bindReconciledValue, sanitizer);
}
return ɵɵproperty;
}

0 comments on commit 53f33c1

Please sign in to comment.
You can’t perform that action at this time.