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

Unified Diff: components/history/core/browser/top_sites_database.cc

Issue 2695883003: Change uses of base::JoinString to pass StringPieces where possible. (Closed)
Patch Set: Remove dependency CL. Created 3 years, 9 months 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
« no previous file with comments | « components/flags_ui/flags_state.cc ('k') | components/nacl/renderer/platform_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/history/core/browser/top_sites_database.cc
diff --git a/components/history/core/browser/top_sites_database.cc b/components/history/core/browser/top_sites_database.cc
index 7e9fc819a0a5f4c92013add5553ac60c6bd45215..3ae0a1088dc4b79f6fb81b5a3dd7a5b12209135b 100644
--- a/components/history/core/browser/top_sites_database.cc
+++ b/components/history/core/browser/top_sites_database.cc
@@ -12,6 +12,7 @@
#include "base/files/file_util.h"
#include "base/memory/ref_counted.h"
#include "base/metrics/histogram_macros.h"
+#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "components/history/core/browser/history_types.h"
@@ -87,9 +88,9 @@ bool InitTables(sql::Connection* db) {
// Encodes redirects into a string.
std::string GetRedirects(const MostVisitedURL& url) {
- std::vector<std::string> redirects;
- for (size_t i = 0; i < url.redirects.size(); i++)
- redirects.push_back(url.redirects[i].spec());
+ std::vector<base::StringPiece> redirects;
+ for (const auto& redirect : url.redirects)
+ redirects.push_back(redirect.spec());
return base::JoinString(redirects, " ");
}
« no previous file with comments | « components/flags_ui/flags_state.cc ('k') | components/nacl/renderer/platform_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698