summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-05-20 14:13:17 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2021-05-20 15:09:32 +0200
commit256c834c30c400034ce35744b74dfea7cf70069c (patch)
treeb036b98c5e7151711abf2a9939137f22bd65fd62 /tools
parent3c41913181f8663f9f1970b13ee038386016d22e (diff)
Simplify a bit: use one minmax in place of 3 min + 3 max calls
Change-Id: Ief2d8d049d2e05ee762e6855514f75be2f053836 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115835 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/generic/gen.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx
index 78025c459d07..34c9fbdfd649 100644
--- a/tools/source/generic/gen.cxx
+++ b/tools/source/generic/gen.cxx
@@ -103,10 +103,8 @@ tools::Rectangle& tools::Rectangle::Union( const tools::Rectangle& rRect )
*this = rRect;
else
{
- nLeft = std::min( std::min( nLeft, rRect.nLeft ), std::min( nRight, rRect.nRight ) );
- nRight = std::max( std::max( nLeft, rRect.nLeft ), std::max( nRight, rRect.nRight ) );
- nTop = std::min( std::min( nTop, rRect.nTop ), std::min( nBottom, rRect.nBottom ) );
- nBottom = std::max( std::max( nTop, rRect.nTop ), std::max( nBottom, rRect.nBottom ) );
+ std::tie(nLeft, nRight) = std::minmax({ nLeft, rRect.nLeft, nRight, rRect.nRight });
+ std::tie(nTop, nBottom) = std::minmax({ nTop, rRect.nTop, nBottom, rRect.nBottom });
}
return *this;