Associative Array potential performance pitfall?

Steven Schveighoffer schveiguy at gmail.com
Fri Mar 13 13:30:16 UTC 2020


On 3/13/20 5:24 AM, H. S. Teoh wrote:
> Note that `arg ~ arg` may allocate, but it also may not if the current
> buffer for `arg` is big enough to accomodate both.

That always allocates. Only appending may avoid allocation:

arg ~= arg;

But, I would instead use ranges if possible to avoid all allocations.

-Steve


More information about the Digitalmars-d-learn mailing list