Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Unified Diff: components/search_engines/template_url_parser.cc

Issue 776903002: Cleanup: Remove some unneeded string allocations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/search_engines/template_url_parser.cc
diff --git a/components/search_engines/template_url_parser.cc b/components/search_engines/template_url_parser.cc
index aa0fd46eba223d94f1f47b8f1d4d98739e880f30..14298da11b6b5381db9598403584cf259bf2b487 100644
--- a/components/search_engines/template_url_parser.cc
+++ b/components/search_engines/template_url_parser.cc
@@ -291,7 +291,8 @@ void TemplateURLParsingContext::CharactersImpl(void* ctx,
const xmlChar* ch,
int len) {
reinterpret_cast<TemplateURLParsingContext*>(ctx)->string_ +=
- base::UTF8ToUTF16(std::string(reinterpret_cast<const char*>(ch), len));
+ base::UTF8ToUTF16(
+ base::StringPiece(reinterpret_cast<const char*>(ch), len));
}
TemplateURL* TemplateURLParsingContext::GetTemplateURL(

Powered by Google App Engine
This is Rietveld 408576698