[Issue 17229] File.byChunk w/ stdout.lockingTextWriter is very slow

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Feb 28 08:45:36 PST 2017


https://issues.dlang.org/show_bug.cgi?id=17229

Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy at yahoo.com

--- Comment #2 from Steven Schveighoffer <schveiguy at yahoo.com> ---
The issue is that LockingTextWriter accepts anything but character range. What
is happening (I think) is that lockingTextWriter.put(someUbyteArray) is
actually putting each ubyte into the stream one at a time after converting each
ubyte into a dchar through integer promotion.

This can't be the intention. I think instead of the constraint

is(ElementType!A : const(dchar))

what we need is something more like:

is(Unqual!(ElementType!A) == dchar)

This might break code, but I think code that is already broken, such as the
example, no?

--


More information about the Digitalmars-d-bugs mailing list