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

Takeshi Abe tabe at fixedpoint.jp
Wed Feb 15 01:14:37 UTC 2017


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

New commits:
commit a88c0611e7c984db241cbcd574096afd050940f8
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Tue Feb 14 23:54:23 2017 +0900

    starmath: Avoid unnecessary stack operations in parsing
    
    unless the top is "nospace".
    
    Change-Id: I03cfa2b8223298370d9d82ce5e149d61e8793737
    Reviewed-on: https://gerrit.libreoffice.org/34249
    Reviewed-by: Takeshi Abe <tabe at fixedpoint.jp>
    Tested-by: Takeshi Abe <tabe at fixedpoint.jp>

diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 1d0129a..b56ed17 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -1030,15 +1030,10 @@ void SmParser::DoExpression()
     bool bUseExtraSpaces = true;
     if (!m_aNodeStack.empty())
     {
-        auto pNode = std::move(m_aNodeStack.front());
-        m_aNodeStack.pop_front();
-        if (pNode->GetToken().eType == TNOSPACE)
-            bUseExtraSpaces = false;
-        else
+        if (m_aNodeStack.front()->GetToken().eType == TNOSPACE)
         {
-            // push the node from above again (now to be used as argument
-            // to this current 'nospace' node)
-            m_aNodeStack.push_front(std::move(pNode));
+            m_aNodeStack.pop_front();
+            bUseExtraSpaces = false;
         }
     }
 


More information about the Libreoffice-commits mailing list