From efab72853b8440d1639753f239826e4eae67f460 Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Wed, 6 Nov 2024 10:17:49 +0000 Subject: [PATCH] Bug 1929258 - Use std::clamp instead of min/max chain in xpfe/appshell/ r=gstoll Differential Revision: https://phabricator.services.mozilla.com/D227971 --- xpfe/appshell/AppWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xpfe/appshell/AppWindow.cpp b/xpfe/appshell/AppWindow.cpp index 3bae75055301..15251422c465 100644 --- a/xpfe/appshell/AppWindow.cpp +++ b/xpfe/appshell/AppWindow.cpp @@ -1233,7 +1233,7 @@ static Maybe ReadSize(const Element& aElement, nsAtom* aAttr, int32_t max = ReadIntAttribute(aElement, aMaxAttr) .valueOr(std::numeric_limits::max()); - return Some(std::min(max, std::max(*attr, min))); + return Some(std::clamp(*attr, min, max)); } bool AppWindow::LoadSizeFromXUL(int32_t& aSpecWidth, int32_t& aSpecHeight) {