summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/GProgressBar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibGUI/GProgressBar.cpp')
-rw-r--r--Libraries/LibGUI/GProgressBar.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/Libraries/LibGUI/GProgressBar.cpp b/Libraries/LibGUI/GProgressBar.cpp
index ba8b8116ec..e0c1076c31 100644
--- a/Libraries/LibGUI/GProgressBar.cpp
+++ b/Libraries/LibGUI/GProgressBar.cpp
@@ -53,10 +53,7 @@ void GProgressBar::set_range(int min, int max)
ASSERT(min < max);
m_min = min;
m_max = max;
- if (m_value > m_max)
- m_value = m_max;
- if (m_value < m_min)
- m_value = m_min;
+ m_value = clamp(m_value, m_min, m_max);
}
void GProgressBar::paint_event(GPaintEvent& event)