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

Unified Diff: components/history/core/browser/history_backend.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
Index: components/history/core/browser/history_backend.cc
diff --git a/components/history/core/browser/history_backend.cc b/components/history/core/browser/history_backend.cc
index ad61094c5702e56dddce0ef178a7d0071ac5969f..19836b7f168bc448937a19d2e08d1a76e0c6ff70 100644
--- a/components/history/core/browser/history_backend.cc
+++ b/components/history/core/browser/history_backend.cc
@@ -1367,7 +1367,8 @@ void HistoryBackend::QueryFilteredURLs(int result_count,
// Limit to the top |result_count| results.
std::sort(data.begin(), data.end(), PageUsageData::Predicate);
- if (result_count && implicit_cast<int>(data.size()) > result_count)
+ DCHECK_GE(result_count, 0);
+ if (result_count && data.size() > static_cast<size_t>(result_count))
data.resize(result_count);
for (size_t i = 0; i < data.size(); ++i) {

Powered by Google App Engine
This is Rietveld 408576698