Bug 1929258 - Use std::clamp instead of min/max chain in xpfe/appshell/ r=gstoll

Differential Revision: https://phabricator.services.mozilla.com/D227971
This commit is contained in:
serge-sans-paille 2024-11-06 10:17:49 +00:00
parent d337c98ae6
commit efab72853b

View File

@ -1233,7 +1233,7 @@ static Maybe<int32_t> ReadSize(const Element& aElement, nsAtom* aAttr,
int32_t max = ReadIntAttribute(aElement, aMaxAttr)
.valueOr(std::numeric_limits<int32_t>::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) {