Bug 1069582 - Check the signed value for < 0 instead. r=sfowler, a=sledru
authorMilan Sreckovic <milan@mozilla.com>
Thu, 18 Sep 2014 16:15:52 -0400
changeset 216812 f8eec8fe1b2b
parent 216811 68fdd69ee9bb
child 216813 b73f15e656a1
push id3921
push userryanvm@gmail.com
push date2014-09-22 15:03 +0000
treeherdermozilla-beta@f8eec8fe1b2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfowler, sledru
bugs1069582
milestone33.0
Bug 1069582 - Check the signed value for < 0 instead. r=sfowler, a=sledru
image/src/imgLoader.cpp
--- a/image/src/imgLoader.cpp
+++ b/image/src/imgLoader.cpp
@@ -1023,20 +1023,19 @@ void imgLoader::GlobalInit()
   if (NS_SUCCEEDED(rv))
     sCacheTimeWeight = timeweight / 1000.0;
   else
     sCacheTimeWeight = 0.5;
 
   int32_t cachesize;
   rv = Preferences::GetInt("image.cache.size", &cachesize);
   if (NS_SUCCEEDED(rv))
-    sCacheMaxSize = cachesize;
+    sCacheMaxSize = cachesize > 0 ? cachesize : 0;
   else
     sCacheMaxSize = 5 * 1024 * 1024;
-  sCacheMaxSize = sCacheMaxSize > 0 ? sCacheMaxSize : 0;
 
   sMemReporter = new imgMemoryReporter();
   RegisterStrongMemoryReporter(sMemReporter);
   RegisterImagesContentUsedUncompressedDistinguishedAmount(imgMemoryReporter::ImagesContentUsedUncompressedDistinguishedAmount);
 }
 
 nsresult imgLoader::InitCache()
 {