COW vs. in-place.

Derek derek at psyc.ward
Mon Jul 31 15:09:51 PDT 2006


On Mon, 31 Jul 2006 16:40:54 -0500, Dave wrote:

> Not a bad idea... The main prob. would be that there would be a lot of 
> duplication of code.

char[] toUpper_inplace(char[] x)
{
   char[] y = toupper(x);
   if (y.ptr == x.ptr)
      return y.dup;
   else
      return y;
}


-- 
Derek Parnell
Melbourne, Australia
"Down with mediocrity!"



More information about the Digitalmars-d mailing list