Bug 1338518 - Followup: Fix incorrect `if` block in SetMemoryGCSliceTimePrefChangedCallback(). r?smaug draft
authorCykesiopka <cykesiopka.bmo@gmail.com>
Sun, 12 Feb 2017 21:51:36 +0800
changeset 482412 b5a824c5a54b8af8fd338b3fdd86bb2832e75440
parent 482411 fdc2509c3737e5236d6c2097ec4ca7102ca7a0e9
child 545420 ce0170104edf7bcb4d5b12c664708502457877a2
push id45066
push usercykesiopka.bmo@gmail.com
push dateSun, 12 Feb 2017 14:05:38 +0000
reviewerssmaug
bugs1338518, 100000
milestone54.0a1
Bug 1338518 - Followup: Fix incorrect `if` block in SetMemoryGCSliceTimePrefChangedCallback(). r?smaug This was found by -Wmisleading-indentation: > nsJSEnvironment.cpp: In function ‘void SetMemoryGCSliceTimePrefChangedCallback(const char*, void*)’: > nsJSEnvironment.cpp:2329:3: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] > if (pref > 0 && pref < 100000) > ^~ > nsJSEnvironment.cpp:2331:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ > JS_SetGCParameter(sContext, JSGC_SLICE_TIME_BUDGET, pref); MozReview-Commit-ID: HWpQatZvdqe
dom/base/nsJSEnvironment.cpp
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -2321,19 +2321,20 @@ SetMemoryGCModePrefChangedCallback(const
   JS_SetGCParameter(sContext, JSGC_MODE, mode);
 }
 
 static void
 SetMemoryGCSliceTimePrefChangedCallback(const char* aPrefName, void* aClosure)
 {
   int32_t pref = Preferences::GetInt(aPrefName, -1);
   // handle overflow and negative pref values
-  if (pref > 0 && pref < 100000)
+  if (pref > 0 && pref < 100000) {
     sActiveIntersliceGCBudget = pref;
     JS_SetGCParameter(sContext, JSGC_SLICE_TIME_BUDGET, pref);
+  }
 }
 
 static void
 SetMemoryGCCompactingPrefChangedCallback(const char* aPrefName, void* aClosure)
 {
   bool pref = Preferences::GetBool(aPrefName);
   JS_SetGCParameter(sContext, JSGC_COMPACTING_ENABLED, pref);
 }