Bug 1445503 - Use MIN instead of unnecessary CLAMP r=karlt
authorMichael Webster <miketwebster@gmail.com>
Wed, 14 Mar 2018 00:50:00 +0200
changeset 408151 d25f89538c90
parent 408150 70500f888010
child 408152 12deaef54bc6
push id33628
push userapavel@mozilla.com
push dateWed, 14 Mar 2018 22:07:41 +0000
treeherdermozilla-central@0d81c80876dd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1445503
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1445503 - Use MIN instead of unnecessary CLAMP r=karlt CLAMP is unnecessary as the minimum acceptable value is 0, and progressPercent is unsigned. CLAMP can trigger the following warning/error in some builds: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -7086,15 +7086,15 @@ nsWindow::SetProgress(unsigned long prog
   if (!mIsX11Display) {
     return;
   }
 
   if (!mShell) {
     return;
   }
 
-  progressPercent = CLAMP(progressPercent, 0, 100);
+  progressPercent = MIN(progressPercent, 100);
 
   set_window_hint_cardinal(GDK_WINDOW_XID(gtk_widget_get_window(mShell)),
                            PROGRESS_HINT,
                            progressPercent);
 #endif // MOZ_X11
-}
\ No newline at end of file
+}