On Wed, 01 May 2013 13:19:16 -0700, Peter Alexander <peter.alexander...@gmail.com> wrote:

The wchar and dchar versions don't reuse the buffer. Not sure why. Here's the implementation, complete with relevant TODO

Wow, that is really awful.

Needs immediate improvement. I would say the following code would be at least a bandaid-fix:

            ...
            if(buf.length == buf.capacity) {
                buf.length = 0;
                buf.assumeSafeAppend();
            } else {
                buf.length = 0;
            }
            foreach (wchar c; s)
            {
                buf ~= c;
            }
            ...

Refactor as desired.

-Steve

Reply via email to