[Webkit-unassigned] [Bug 63330] Concatenating wide strings and WTF::Strings using operator+ is suboptimal on MSVC

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 24 12:42:47 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=63330





--- Comment #3 from Adam Roben (:aroben) <aroben at apple.com>  2011-06-24 12:42:47 PST ---
(In reply to comment #2)
> (In reply to comment #0)
> > The following code:
> > 
> > String color("brown");
> > String workEthic("lazy");
> > String result = L"The quick " + color + L" fox jumped over the " + workEthic + L" dogs";
> > 
> > ...doesn't behave in an optimal way. The optimal behavior would be for the + expressions to build up a StringAppend object, and only to convert to a String at the very end. What actually happens is:
> > 
> > 1. L"The quick " is converted to a String
> Sounds like the right StringTypeAdapter is missing.
> Try adding one for your string type in JavaScriptCore/wtf/text/StringConcatenate.h, that will make the String conversion unncessary when invoking operator+.

There is already a StringTypeAdapter<const UChar*>. On Windows, UChar == wchar_t. So there's already the correct StringTypeAdapter for wide strings.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list