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 |