Performance optimization using our string classes would be helped if all string classes allowed dependent assignment rather than just nsDependent[C]S[ubs]tring. Dependent substring assignment would require a check that the class type supports it -- and fallback to Assign (perhaps with assertion, although I'm currently thinking without) if it doesn't. I'd also want a version of ns[C]AutoString that doesn't imply termination. Preliminary patch coming.
Created attachment 195479 [details] [diff] [review] untested patch Untested, but compiles through xpcom.
Comment on attachment 195479 [details] [diff] [review] untested patch nsString implies termination (remember nsAFlatString). I think it will be hard to change that. It confuses me to see nsTAutoSubstring inherit from nsTAutoString since nsTAutoString eventually inherits from nsTSubstring. I sort of think that it's only going to work to allow setting a dependent and null-terminated buffer on a nsTString.
David Baron :dbaron: 🏴 ⌚UTC-8 (if account gets disabled due to email bounces, ask a bugzilla admin to reenable it)(Reporter)
14 years ago
Priority: -- → P1
Target Milestone: --- → mozilla1.9alpha
(In reply to comment #2) > nsString implies termination (remember nsAFlatString). I think it will be hard > to change that. I didn't change that, with the one exception of nsTAutoSubstring. > It confuses me to see nsTAutoSubstring inherit from nsTAutoString since > nsTAutoString eventually inherits from nsTSubstring. > > I sort of think that it's only going to work to allow setting a dependent and > null-terminated buffer on a nsTString. Yeah, it's odd, but it's also exactly what nsStandardURL::BuildNormalizedSpec should have been using, and I don't see any other easy way to do it.
Created attachment 251295 [details] [diff] [review] untested patch This is tested in that I had it in my tree for months (I'm just removing it now) and it didn't break anything, but I haven't really tested the new stuff.
Attachment #195479 - Attachment is obsolete: true
Assignee: dbaron → nobody
Priority: P1 → P3
Target Milestone: mozilla1.9alpha1 → ---
You need to log in before you can comment on or make changes to this bug.