summaryrefslogtreecommitdiffstats
path: root/starmath
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2017-02-14 23:54:23 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2017-02-15 01:14:17 +0000
commita88c0611e7c984db241cbcd574096afd050940f8 (patch)
treea06b3baba2bc31c293b09452041a2b18aa7b6784 /starmath
parentRelated: tdf#105672 Load toolbar properties from .ui (diff)
downloadcore-a88c0611e7c984db241cbcd574096afd050940f8.tar.gz
core-a88c0611e7c984db241cbcd574096afd050940f8.zip
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@fixedpoint.jp> Tested-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/parse.cxx11
1 files changed, 3 insertions, 8 deletions
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 1d0129a23df5..b56ed17d76cd 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;
}
}