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

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

Issue 1340683002: Remove base's implicit_cast. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: implicitcast: numericstest Created 5 years, 3 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/history/core/browser/history_backend.cc ('k') | content/browser/cache_storage/cache_storage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/history/core/browser/visitsegment_database.cc
diff --git a/components/history/core/browser/visitsegment_database.cc b/components/history/core/browser/visitsegment_database.cc
index afeecb71441946eafbdbce5c4b15c9a4320d3106..232e044258d68e678daea8ed9eb96ca8ef3c0a0d 100644
--- a/components/history/core/browser/visitsegment_database.cc
+++ b/components/history/core/browser/visitsegment_database.cc
@@ -258,7 +258,8 @@ void VisitSegmentDatabase::QuerySegmentUsage(
// Limit to the top kResultCount results.
std::sort(results->begin(), results->end(), PageUsageData::Predicate);
- if (static_cast<int>(results->size()) > max_result_count) {
+ DCHECK_GE(max_result_count, 0);
+ if (results->size() > static_cast<size_t>(max_result_count)) {
STLDeleteContainerPointers(results->begin() + max_result_count,
results->end());
results->resize(max_result_count);
« no previous file with comments | « components/history/core/browser/history_backend.cc ('k') | content/browser/cache_storage/cache_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698