diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2018-07-13 14:40:07 +0900 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-19 14:48:27 +0200 |
commit | e020cc88161ca5f3b35b629da627a530cb618532 (patch) | |
tree | e67b6b2f90def0409a5ca194a723a97d8c9e8a06 /toolkit | |
parent | e68783344a88b827c5fe6a0fd1174b36d75d4d3c (diff) |
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@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/controls/grid/defaultgriddatamodel.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
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, |