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

Unified Diff: chrome/browser/themes/browser_theme_pack.cc

Issue 747013003: Various optimizations to reduce the number of temporary allocations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed two calls to string::reserve(). 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: chrome/browser/themes/browser_theme_pack.cc
diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc
index fe2f645cb496e972096827d983f38a0818de9092..98099530be66de49c2cedbb8a1f6f1ff09b2593f 100644
--- a/chrome/browser/themes/browser_theme_pack.cc
+++ b/chrome/browser/themes/browser_theme_pack.cc
@@ -779,18 +779,18 @@ scoped_refptr<BrowserThemePack> BrowserThemePack::BuildFromDataPack(
}
// static
-void BrowserThemePack::GetThemeableImageIDRs(std::set<int>* result) {
- if (!result)
- return;
-
- result->clear();
+bool BrowserThemePack::IsThemeableImageIDRs(int id) {
for (size_t i = 0; i < kPersistingImagesLength; ++i)
- result->insert(kPersistingImages[i].idr_id);
+ if (kPersistingImages[i].idr_id == id)
+ return true;
#if defined(USE_ASH) && !defined(OS_CHROMEOS)
for (size_t i = 0; i < kPersistingImagesDesktopAuraLength; ++i)
- result->insert(kPersistingImagesDesktopAura[i].idr_id);
+ if (kPersistingImagesDesktopAura[i].idr_id == id)
+ return true;
#endif
+
+ return false;
}
bool BrowserThemePack::WriteToDisk(const base::FilePath& path) const {

Powered by Google App Engine
This is Rietveld 408576698