DMD 1.019 and 2.003 releases

James Dennett jdennett at acm.org
Tue Jul 24 12:02:12 PDT 2007


BCS wrote:
> Reply to Walter,
> 
>>
>> c += 'a' - 'A';   // to lower case
> 
> this is safer and faster (Ihink)
> 
> c |= 0b0010_0000;

Walter's version works on any platform where upper and lower
case letters have the same arrangement, including any gaps;
yours is pretty much tied to ASCII and extensions thereof.

(On the other hand, yours is idempotent, whereas Walter's
depends on knowing that c started as upper case.)

-- James



More information about the Digitalmars-d-announce mailing list