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

Takeshi Abe tabe at fixedpoint.jp
Mon May 2 01:19:31 UTC 2016


 starmath/source/parse.cxx |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 07a641b110beee4f7c76617fcd6ed558025321a2
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Thu Apr 28 16:51:07 2016 +0900

    Reduce scope of variables
    
    Change-Id: I0018a6601f48f32736d10fd1eab58e926d97f91b
    Reviewed-on: https://gerrit.libreoffice.org/24458
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Takeshi Abe <tabe at fixedpoint.jp>

diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 6a7d76b..a541893 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -1420,8 +1420,7 @@ void SmParser::DoTerm(bool bGroupNumberIdent)
                 {
                     // We have several concatenated identifiers and numbers.
                     // Let's group them into one SmExpressionNode.
-                    SmNodeArray nodeArray;
-                    nodeArray.resize(nTokens);
+                    SmNodeArray nodeArray(nTokens);
                     while (nTokens > 0)
                     {
                         nodeArray[nTokens-1] = popOrZero(m_aNodeStack);
@@ -2178,7 +2177,6 @@ void SmParser::DoBinom()
 
 void SmParser::DoStack()
 {
-    SmNodeArray  ExpressionArray;
     NextToken();
     if (m_aCurToken.eType == TLGROUP)
     {
@@ -2192,7 +2190,7 @@ void SmParser::DoStack()
         }
         while (m_aCurToken.eType == TPOUND);
 
-        ExpressionArray.resize(n);
+        SmNodeArray ExpressionArray(n);
 
         for (sal_uInt16 i = 0; i < n; i++)
         {
@@ -2218,8 +2216,6 @@ void SmParser::DoStack()
 
 void SmParser::DoMatrix()
 {
-    SmNodeArray  ExpressionArray;
-
     NextToken();
     if (m_aCurToken.eType == TLGROUP)
     {
@@ -2257,7 +2253,7 @@ void SmParser::DoMatrix()
 
         size_t nRC = static_cast<size_t>(r) * c;
 
-        ExpressionArray.resize(nRC);
+        SmNodeArray ExpressionArray(nRC);
 
         for (size_t i = 0; i < (nRC); ++i)
         {


More information about the Libreoffice-commits mailing list