> On Dec 30, 2023, at 3:18 PM, Michael Van Canneyt via fpc-pascal 
> <fpc-pascal@lists.freepascal.org> wrote:
> 
> And try to avoid "for r in data" because it will create a copy for each 
> element
> in the list.

This seems more like bad compiler design than anything. From the users 
perspective a for loop is a read-only operation and shouldn't be copying 
anything. I know it's how the enumerator thing is done but that may have been a 
bad design from the start or needs some extra optimization somewhere.

For OP I would just kill the for-in loop in favor of a normal for-do loop and 
be done with the problem.

Regards,
Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to