[Libreoffice-commits] core.git: sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sat Nov 17 06:34:11 UTC 2018
sc/source/core/tool/interpr5.cxx | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
New commits:
commit f5011d7226060e04e7b92f035f71e285b853712c
Author: Takeshi Abe <tabe at fixedpoint.jp>
AuthorDate: Wed Oct 17 21:54:53 2018 +0900
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Nov 17 07:33:50 2018 +0100
sc: Calculate the value only once for micro-optimization
Change-Id: I394bca979d4b914d6b6997837fab636b9bc4e479
Reviewed-on: https://gerrit.libreoffice.org/61879
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index 2b30f4e1fe49..b1c840e4fd94 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -1861,8 +1861,11 @@ double lcl_GetColumnMaximumNorm(const ScMatrixRef& pMatA, SCSIZE nC, SCSIZE nR,
{
double fNorm = 0.0;
for (SCSIZE row=nR; row<nN; row++)
- if (fNorm < fabs(pMatA->GetDouble(nC,row)))
- fNorm = fabs(pMatA->GetDouble(nC,row));
+ {
+ double fVal = fabs(pMatA->GetDouble(nC,row));
+ if (fNorm < fVal)
+ fNorm = fVal;
+ }
return fNorm;
}
@@ -1872,8 +1875,11 @@ double lcl_TGetColumnMaximumNorm(const ScMatrixRef& pMatA, SCSIZE nR, SCSIZE nC,
{
double fNorm = 0.0;
for (SCSIZE col=nC; col<nN; col++)
- if (fNorm < fabs(pMatA->GetDouble(col,nR)))
- fNorm = fabs(pMatA->GetDouble(col,nR));
+ {
+ double fVal = fabs(pMatA->GetDouble(col,nR));
+ if (fNorm < fVal)
+ fNorm = fVal;
+ }
return fNorm;
}
More information about the Libreoffice-commits
mailing list