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

Unified Diff: net/disk_cache/cache_util.cc

Issue 637023002: Misc. cleanup, primarily removing unused locals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove macros.h change Created 6 years, 2 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: net/disk_cache/cache_util.cc
diff --git a/net/disk_cache/cache_util.cc b/net/disk_cache/cache_util.cc
index ea39df00d9e2e24e04e27be8179709237b4f6219..167113860d611f80c704939872c2bbe695939fa5 100644
--- a/net/disk_cache/cache_util.cc
+++ b/net/disk_cache/cache_util.cc
@@ -145,15 +145,12 @@ int PreferredCacheSize(int64 available) {
if (available < 0)
return kDefaultCacheSize;
- int64 max_size = PreferredCacheSizeInternal(available);
-
// Limit cache size to somewhat less than kint32max to avoid potential
// integer overflows in cache backend implementations.
- DCHECK(kDefaultCacheSize * 4 < kint32max);
- if (max_size > kDefaultCacheSize * 4)
- max_size = kDefaultCacheSize * 4;
-
- return implicit_cast<int32>(max_size);
Peter Kasting 2014/10/08 19:21:56 This needs a static_cast, not an implicit_cast, to
rvargas (doing something else) 2014/10/08 20:01:14 Certainly!
+ DCHECK_LT(kDefaultCacheSize * 4, kint32max);
+ return static_cast<int32>(std::min(
+ PreferredCacheSizeInternal(available),
+ static_cast<int64>(kDefaultCacheSize * 4)));
}
} // namespace disk_cache

Powered by Google App Engine
This is Rietveld 408576698