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); |