Is all this Invarient **** er... stuff, premature optimisation?

Walter Bright newshound1 at digitalmars.com
Mon Apr 28 18:57:22 PDT 2008


Robert Fraser wrote:
> The important part is new String(offset + beginIndex, endIndex - 
> beginIndex, value) which does indeed do a "slice" of sorts (that is, it 
> returns a string with the same char array backing it with a new offset 
> and length). No copying of data is done.

Yes, you are right. I was wrong. But Java is still new'ing a new 
instance of String for each slice. And it still uses two levels of 
indirection to get to the string data.



More information about the Digitalmars-d mailing list