RESOLVED WORKSFORME20039
Implement UString::adopt
https://bugs.webkit.org/show_bug.cgi?id=20039
Summary Implement UString::adopt
Adam Barth
Reported 2008-07-15 02:30:02 PDT
It is handy to be able to transfer ownership of a Vector<UChar> into a UString without having to memcpy the contents of the vector. This can be done with the public API of UString, but it would be more convenient to have a UString::adopt(Vector<UChar>&) method.
Attachments
patch (2.09 KB, patch)
2008-07-15 02:30 PDT, Adam Barth
sam: review-
non-perf tested version of what I was thinking (5.69 KB, patch)
2008-07-15 13:44 PDT, Sam Weinig
no flags
Adam Barth
Comment 1 2008-07-15 02:30:41 PDT
Sam Weinig
Comment 2 2008-07-15 13:26:49 PDT
Comment on attachment 22278 [details] patch I would rather we remove non-copying version of the UString constructor and only use adopt.
Sam Weinig
Comment 3 2008-07-15 13:44:30 PDT
Created attachment 22287 [details] non-perf tested version of what I was thinking
Adam Barth
Comment 4 2008-07-15 16:58:54 PDT
> I would rather we remove non-copying version of the UString constructor and > only use adopt. Yes, that's a good idea. The non-copying constructor is just asking for memory errors.
Gavin Barraclough
Comment 5 2011-08-25 15:17:25 PDT
This now exists!
Note You need to log in before you can comment on or make changes to this bug.