summaryrefslogtreecommitdiff
path: root/starmath/source/parse.cxx
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2016-04-28 16:51:07 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2016-05-02 01:19:04 +0000
commit07a641b110beee4f7c76617fcd6ed558025321a2 (patch)
tree6ed76c0dc06b6db94d89ada43979bbf002bd8fb2 /starmath/source/parse.cxx
parent097bf754c09e8b1ba57e3367baa010898611b61b (diff)
Reduce scope of variables
Change-Id: I0018a6601f48f32736d10fd1eab58e926d97f91b Reviewed-on: https://gerrit.libreoffice.org/24458 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath/source/parse.cxx')
-rw-r--r--starmath/source/parse.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 6a7d76b5f02e..a54189318cb7 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)
{