Skip to content

Commit b0425ea

Browse files
crisbetothePunderWoman
authored andcommitted
refactor(core): simplify single interpolations (angular#61639)
Updates the `ɵɵinterpolate` instruction so it doesn't call into `interpolation1` under the hood since it requires a prefix/suffix and we know there isn't one. PR Close angular#61639
1 parent e412fda commit b0425ea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/core/src/render3/instructions/value_interpolation.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import {getLView} from '../state';
9+
import {bindingUpdated} from '../bindings';
10+
import {getLView, nextBindingIndex} from '../state';
1011
import {NO_CHANGE} from '../tokens';
12+
import {renderStringify} from '../util/stringify_utils';
1113
import {
1214
interpolation1,
1315
interpolation2,
@@ -28,7 +30,9 @@ import {
2830
* @codeGenApi
2931
*/
3032
export function ɵɵinterpolate(v0: any): string | NO_CHANGE {
31-
return interpolation1(getLView(), '', v0, '');
33+
// Avoid calling into the `interpolate` functions since
34+
// we know that we don't have a prefix or suffix.
35+
return bindingUpdated(getLView(), nextBindingIndex(), v0) ? renderStringify(v0) : NO_CHANGE;
3236
}
3337

3438
/**

0 commit comments

Comments
 (0)