tools/source/generic/gen.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 256c834c30c400034ce35744b74dfea7cf70069c
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Thu May 20 14:13:17 2021 +0200
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Thu May 20 15:09:32 2021 +0200

    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.kagan...@collabora.com>

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;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to