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

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Sat Oct 24 05:17:13 UTC 2020


 sc/source/core/tool/interpr6.cxx |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

New commits:
commit a260bf6cc5ee1494e3aeacbf4f045a3fd4d3963e
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Fri Oct 23 17:41:08 2020 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Sat Oct 24 07:16:32 2020 +0200

    simplify a bit
    
    Change-Id: I46473789828ea38aaec2c738aa57ec18b30e7c1a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104734
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx
index f482b16e3549..57c0a89fb84d 100644
--- a/sc/source/core/tool/interpr6.cxx
+++ b/sc/source/core/tool/interpr6.cxx
@@ -513,11 +513,8 @@ void ScInterpreter::IterateParameters( ScIterFunc eFunc, bool bTextAsZero )
     short nParamCount = GetByte();
     const SCSIZE nMatRows = GetRefListArrayMaxSize( nParamCount);
     ScMatrixRef xResMat, xResCount;
-    auto ResInitVal = [eFunc]()
-    {
-        return (eFunc == ifPRODUCT) ? 1.0 : 0.0;
-    };
-    double fRes = ResInitVal();
+    const double ResInitVal = (eFunc == ifPRODUCT) ? 1.0 : 0.0;
+    double fRes = ResInitVal;
     double fVal = 0.0;
     double fMem = 0.0;  // first numeric value != 0.0
     sal_uLong nCount = 0;
@@ -772,7 +769,7 @@ void ScInterpreter::IterateParameters( ScIterFunc eFunc, bool bTextAsZero )
                                 xResCount->PutDouble( xResCount->GetDouble(0,i) + nCount, 0,i);
                             }
                         }
-                        if (fRes != ResInitVal())
+                        if (fRes != ResInitVal)
                         {
                             for (SCSIZE i=0; i < nMatRows; ++i)
                             {
@@ -785,7 +782,7 @@ void ScInterpreter::IterateParameters( ScIterFunc eFunc, bool bTextAsZero )
                             }
                         }
                     }
-                    fRes = ResInitVal();
+                    fRes = ResInitVal;
                     nCount = 0;
                 }
             }
@@ -967,7 +964,7 @@ void ScInterpreter::IterateParameters( ScIterFunc eFunc, bool bTextAsZero )
                         fVecRes += fRes;
                     xResMat->PutDouble( fVecRes, 0,nRefArrayPos);
                     // Reset.
-                    fRes = ResInitVal();
+                    fRes = ResInitVal;
                     nCount = 0;
                     nRefArrayPos = std::numeric_limits<size_t>::max();
                 }


More information about the Libreoffice-commits mailing list