diff options
author | Eike Rathke <erack@redhat.com> | 2016-04-22 18:42:05 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-04-23 15:52:32 +0200 |
commit | 737040e5db1b74f49d3a075ac4c64e218b1134de (patch) | |
tree | 0f9e9ee18a7a82748304a2b259b490a87035e83e /formula/source | |
parent | 4c5932cf06f0434a0df32203d567cab976402011 (diff) |
change multiple ifs to switch case
... obtaining mpToken->GetOpCode() only once.
Change-Id: I909fef97540998a7f09115738fb76a1e963480bf
Diffstat (limited to 'formula/source')
-rw-r--r-- | formula/source/core/api/FormulaCompiler.cxx | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 31004d453973..492abb078bf8 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -1101,27 +1101,29 @@ bool FormulaCompiler::GetToken() mpToken = new FormulaByteToken( ocStop ); return false; } - if ( mpToken->GetOpCode() == ocSubTotal || mpToken->GetOpCode() == ocAggregate ) - glSubTotal = true; - else if ( mpToken->IsExternalRef() ) + if ( mpToken->IsExternalRef() ) { return HandleExternalReference(*mpToken); } - else if( mpToken->GetOpCode() == ocName ) - { - return HandleRange(); - } - else if( mpToken->GetOpCode() == ocColRowName ) - { - return HandleColRowName(); - } - else if( mpToken->GetOpCode() == ocDBArea ) - { - return HandleDbData(); - } - else if( mpToken->GetOpCode() == ocTableRef ) + else { - return HandleTableRef(); + switch (mpToken->GetOpCode()) + { + case ocSubTotal: + case ocAggregate: + glSubTotal = true; + break; + case ocName: + return HandleRange(); + case ocColRowName: + return HandleColRowName(); + case ocDBArea: + return HandleDbData(); + case ocTableRef: + return HandleTableRef(); + default: + ; // nothing + } } return true; } |