Comment #0 by stanislav.blinov — 2020-06-18T14:26:51Z
Since it's using an appender, it seems strange that it goes via the std.conv.to.
Comment #1 by schveiguy — 2020-06-18T14:36:15Z
Yes, agree. And also, the code is all in there -- the code that writes the converted int to a static array buffer can be factored out of toImpl, and used to avoid an extra allocation.
Comment #2 by stanislav.blinov — 2020-06-18T15:42:22Z
Why just int?
Comment #3 by schveiguy — 2020-06-18T17:06:09Z
That is the current case. I agree it shouldn't needlessly allocate if it can help it. But then the "fix" needs to be defined as to how much allocation is needed.
Int is straightforward -- the code is already in std.conv that can convert an int to text without allocation. The general case is not as straightforward.
Comment #4 by stanislav.blinov — 2020-06-19T12:43:06Z