[Libreoffice-commits] core.git: toolkit/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Aug 19 12:48:50 UTC 2018


 toolkit/source/controls/grid/defaultgriddatamodel.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit e020cc88161ca5f3b35b629da627a530cb618532
Author:     Takeshi Abe <tabe at fixedpoint.jp>
AuthorDate: Fri Jul 13 14:40:07 2018 +0900
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Aug 19 14:48:27 2018 +0200

    toolkit: a micro-optimization taking min and max simulnateously
    
    Change-Id: I161dd318b1e5729ef0b8c55a41c0eddc681b153f
    Reviewed-on: https://gerrit.libreoffice.org/57612
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.cxx b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
index 4a25f01237e0..e613878a3166 100644
--- a/toolkit/source/controls/grid/defaultgriddatamodel.cxx
+++ b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
@@ -404,8 +404,9 @@ private:
             rDataRow[ columnIndex ].first = i_values[ col ];
         }
 
-        sal_Int32 const firstAffectedColumn = *::std::min_element( i_columnIndexes.begin(), i_columnIndexes.end() );
-        sal_Int32 const lastAffectedColumn = *::std::max_element( i_columnIndexes.begin(), i_columnIndexes.end() );
+        auto aPair = ::std::minmax_element( i_columnIndexes.begin(), i_columnIndexes.end() );
+        sal_Int32 const firstAffectedColumn = *aPair.first;
+        sal_Int32 const lastAffectedColumn = *aPair.second;
         broadcast(
             GridDataEvent( *this, firstAffectedColumn, lastAffectedColumn, i_rowIndex, i_rowIndex ),
             &XGridDataListener::dataChanged,


More information about the Libreoffice-commits mailing list