[Libreoffice-commits] core.git: Branch 'feature/fixes35' - sc/source
Michael Meeks
michael.meeks at collabora.com
Thu Sep 15 11:21:55 UTC 2016
sc/source/core/inc/interpre.hxx | 4 ++--
sc/source/core/tool/interpr1.cxx | 20 +++++++++++---------
2 files changed, 13 insertions(+), 11 deletions(-)
New commits:
commit 80938c6d19f67789a31d274030582b2c42c20500
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Sep 15 11:54:32 2016 +0100
sc: templatize iteration to help the optimizer.
A cheap & easy way to reduce the amount of redundant floating point
math going on in the inner-loops of sumifs, countifs etc.
Change-Id: Iafd8dd1bae375c8216cd6be1247e508d8207580a
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index a01b60b..86389bc 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -551,11 +551,11 @@ void ScColumn();
void ScRow();
void ScSheet();
void ScMatch();
-double IterateParametersIf( ScIterFuncIf );
void ScCountIf();
void ScSumIf();
void ScAverageIf();
-double IterateParametersIfs( ScIterFuncIfs );
+template< ScIterFuncIf > double IterateParametersIf();
+template< ScIterFuncIfs > double IterateParametersIfs();
void ScSumIfs();
void ScAverageIfs();
void ScCountIfs();
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index f540da9..5ec60e2 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -4704,7 +4704,8 @@ void ScInterpreter::ScCountEmptyCells()
}
}
-double ScInterpreter::IterateParametersIf( ScIterFuncIf eFunc )
+template< ScIterFuncIf eFunc >
+double ScInterpreter::IterateParametersIf()
{
sal_uInt8 nParamCount = GetByte();
if ( !MustHaveParamCount( nParamCount, 2, 3 ) )
@@ -5113,12 +5114,12 @@ double ScInterpreter::IterateParametersIf( ScIterFuncIf eFunc )
void ScInterpreter::ScSumIf()
{
- PushDouble( IterateParametersIf( ifSUMIF));
+ PushDouble( IterateParametersIf< ifSUMIF> ());
}
void ScInterpreter::ScAverageIf()
{
- PushDouble( IterateParametersIf( ifAVERAGEIF));
+ PushDouble( IterateParametersIf< ifAVERAGEIF >());
}
void ScInterpreter::ScCountIf()
@@ -5311,7 +5312,8 @@ void ScInterpreter::ScCountIf()
}
}
-double ScInterpreter::IterateParametersIfs( ScIterFuncIfs eFunc )
+template< ScIterFuncIfs eFunc >
+double ScInterpreter::IterateParametersIfs()
{
sal_uInt8 nParamCount = GetByte();
sal_uInt8 nQueryCount = nParamCount / 2;
@@ -5739,28 +5741,28 @@ double ScInterpreter::IterateParametersIfs( ScIterFuncIfs eFunc )
void ScInterpreter::ScSumIfs()
{
- PushDouble( IterateParametersIfs( ifSUMIFS));
+ PushDouble( IterateParametersIfs< ifSUMIFS >() );
}
void ScInterpreter::ScAverageIfs()
{
- PushDouble( IterateParametersIfs( ifAVERAGEIFS));
+ PushDouble( IterateParametersIfs< ifAVERAGEIFS >() );
}
void ScInterpreter::ScCountIfs()
{
- PushDouble( IterateParametersIfs( ifCOUNTIFS));
+ PushDouble( IterateParametersIfs< ifCOUNTIFS >() );
}
void ScInterpreter::ScMinIfs_MS()
{
- PushDouble( IterateParametersIfs( ifMINIFS ) );
+ PushDouble( IterateParametersIfs< ifMINIFS >() );
}
void ScInterpreter::ScMaxIfs_MS()
{
- PushDouble( IterateParametersIfs( ifMAXIFS ) );
+ PushDouble( IterateParametersIfs< ifMAXIFS >() );
}
void ScInterpreter::ScLookup()
More information about the Libreoffice-commits
mailing list