Rewrite std::string("") to std::string(), Linux edition.
This patch was generated by running the empty_string clang tool
across the Chromium Linux compilation database. Implicitly or
explicitly constructing std::string() with a "" argument is
inefficient as the caller needs to emit extra instructions to
pass an argument, and the constructor needlessly copies a byte
into internal storage. Rewriting these instances to simply call
the default constructor appears to save ~14-18 kilobytes on an
optimized release build.
BUG=none
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=193020
Review URL: https://codereview.chromium.org/13145003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193040 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index a6068b5..368d048 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -1192,7 +1192,7 @@
EXPECT_EQ(std::string(good1), loaded_[1]->id());
EXPECT_EQ(std::string("My extension 2"), loaded_[1]->name());
- EXPECT_EQ(std::string(""), loaded_[1]->description());
+ EXPECT_EQ(std::string(), loaded_[1]->description());
EXPECT_EQ(loaded_[1]->GetResourceURL("background.html"),
extensions::BackgroundInfo::GetBackgroundURL(loaded_[1]));
EXPECT_EQ(
@@ -1220,7 +1220,7 @@
int index = expected_num_extensions - 1;
EXPECT_EQ(std::string(good2), loaded_[index]->id());
EXPECT_EQ(std::string("My extension 3"), loaded_[index]->name());
- EXPECT_EQ(std::string(""), loaded_[index]->description());
+ EXPECT_EQ(std::string(), loaded_[index]->description());
EXPECT_EQ(
0u,
extensions::ContentScriptsInfo::GetContentScripts(loaded_[index]).size());
@@ -3313,8 +3313,8 @@
// UNPACKED is for extensions loaded from a directory. We use it here, even
// though we're testing loading from prefs, so that we don't need to provide
// an extension key.
- extensions::ExtensionInfo extension_info(&manifest, "", path,
- Manifest::UNPACKED);
+ extensions::ExtensionInfo extension_info(
+ &manifest, std::string(), path, Manifest::UNPACKED);
// Ensure we can load it with no management policy in place.
management_policy_->UnregisterAllProviders();