ListMixin contains
calls the length getter twice per iteration
#30478
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
Unlike other iteration functions in
ListMixin
,contains
use the length getter in the header of the for loop instead of using the local variable that stores the length on entry. Combined with the the additional check for concurrent modification, this means that the length getter is called twice per iteration. dart2js is not able to inline and optimize this code, at least in large internal customer apps.Filed #30477 for the concurrent modification check, but at least only checking once per iteration would probably be good.
The text was updated successfully, but these errors were encountered: