refactor(animations): uses a loop instead Array.map() which creates and (#19910)

returns a new array that is discarded.

This pattern will become a compilation error in google3.

PR Close #19910
This commit is contained in:
Bowen Ni 2017-10-24 11:30:37 -07:00 committed by Jason Aden
parent 161f88fe6f
commit 743651f5e8
1 changed files with 2 additions and 2 deletions

View File

@ -1225,7 +1225,7 @@ export class TransitionAnimationEngine {
const targetTriggerName: string|undefined = const targetTriggerName: string|undefined =
instruction.isRemovalTransition ? undefined : triggerName; instruction.isRemovalTransition ? undefined : triggerName;
instruction.timelines.map(timelineInstruction => { for (const timelineInstruction of instruction.timelines) {
const element = timelineInstruction.element; const element = timelineInstruction.element;
const isQueriedElement = element !== rootElement; const isQueriedElement = element !== rootElement;
const players = getOrSetAsInMap(allPreviousPlayersMap, element, []); const players = getOrSetAsInMap(allPreviousPlayersMap, element, []);
@ -1239,7 +1239,7 @@ export class TransitionAnimationEngine {
player.destroy(); player.destroy();
players.push(player); players.push(player);
}); });
}); }
// this needs to be done so that the PRE/POST styles can be // this needs to be done so that the PRE/POST styles can be
// computed properly without interfering with the previous animation // computed properly without interfering with the previous animation