[Libreoffice-commits] core.git: sc/source
Jochen Nitschke
j.nitschke+logerrit at ok.de
Wed Apr 5 07:02:22 UTC 2017
sc/source/core/tool/interpr4.cxx | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
New commits:
commit 034e35d789cd6e349c456e273d18d5128e1580bf
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date: Tue Apr 4 11:25:26 2017 +0200
sc: use std::reverse
Change-Id: I16505d15cc7e1d82409f15107d1c5af3bf811c11
Reviewed-on: https://gerrit.libreoffice.org/36069
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index c044db1120cc..976f163a5e67 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -1899,15 +1899,9 @@ StackVar ScInterpreter::GetStackType( sal_uInt8 nParam )
void ScInterpreter::ReverseStack( sal_uInt8 nParamCount )
{
//reverse order of parameter stack
- const FormulaToken* p;
assert( sp >= nParamCount && " less stack elements than parameters");
- short nStackParams = std::min<short>( sp, nParamCount);
- for ( short i = 0; i < short( nStackParams / 2 ); i++ )
- {
- p = pStack[ sp - ( nStackParams - i ) ];
- pStack[ sp - ( nStackParams - i ) ] = pStack[ sp - 1 - i ];
- pStack[ sp - 1 - i ] = p;
- }
+ sal_uInt16 nStackParams = std::min<sal_uInt16>( sp, nParamCount);
+ std::reverse( pStack+(sp-nStackParams), pStack+sp );
}
bool ScInterpreter::DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& rAdr )
More information about the Libreoffice-commits
mailing list