Xidorn Quan wrote:

The method name AssignLiteral can easily make people at the callee side think 
it makes the string point to a piece of static data, which has no runtime 
penalty. But this is false.
Actually nsACString::AssignLiteral used to copy too until I fixed it last year.

Hence I think we should remove this method. All callees should use either 
AssignLiteral(MOZ_UTF16("some string")), or, if don't want to bloat the binary, 
explicitly use AssignASCII("some string").

I already tried that, but AssignASCII takes a const char* parameter which has an implicit conversion from a string literal thus making it impossible to overload with a template. I do have a patch somewhere that changes most of the tree to use AssignLiteral(MOZ_UTF16()) if you're interested.

--
Warning: May contain traces of nuts.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to