January 31, 2021 Re: 200-600x slower Dlang performance with nested foreach loop | ||||
---|---|---|---|---|
| ||||
Posted in reply to methonash | On Sunday, 31 January 2021 at 16:50:15 UTC, methonash wrote:
> What confuses me, at this point, is this: I originally wrote the D code using foreach in this style:
>
> foreach( i, ref parentString; strings )
> foreach( j, ref childString; strings[ i + 1 .. $ ] )
>
> Essentially, the value of j printed to stdout should always be larger than the value of i.
j is counted from current begginning: from 0
strings[i+1..$][0] - its right behaviour
|
Copyright © 1999-2021 by the D Language Foundation