Why do you decode ? (Seriously)

Artur Skawina art.08.09 at gmail.com
Thu Aug 2 13:40:03 PDT 2012


On 08/02/12 18:47, Dmitry Olshansky wrote:
> char[] input = ...;
> size_t idx = ...;
> size_t len = stride(input, idx);
> uint u8word = *cast(uint*)(input.ptr+idx);

> So why do we use dchar and not UTF-8 word, as it's as good as dchar and faster to obtain? 

Iff unaligned accesses happen to be legal on the platform _and_ iff doing
them is faster than the (not that complex) decoding.

artur


More information about the Digitalmars-d mailing list