basic/source/comp/loops.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
New commits: commit 68b782a2791f23d44f4d5185003c33ddaaef9b1f Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Jul 14 14:49:12 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Jul 14 18:26:13 2024 +0200 cid#1607572 silence bogus Copy-paste error Change-Id: Id8355a033089a47299d76e1743b7da5a1b4a5d5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170454 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/basic/source/comp/loops.cxx b/basic/source/comp/loops.cxx index 1d7f9ff84dfd..12053291fb8b 100644 --- a/basic/source/comp/loops.cxx +++ b/basic/source/comp/loops.cxx @@ -23,6 +23,11 @@ #include <basic/sberrors.hxx> +static bool EndsIfBranch(SbiToken eTok) +{ + return eTok == ELSEIF || eTok == ELSE || eTok == ENDIF; +} + // Single-line IF and Multiline IF void SbiParser::If() @@ -45,8 +50,7 @@ void SbiParser::If() // multiline IF nEndLbl = aGen.Gen( SbiOpcode::JUMPF_, 0 ); eTok = Peek(); - while( !( eTok == ELSEIF || eTok == ELSE || eTok == ENDIF ) && - !bAbort && Parse() ) + while (!EndsIfBranch(eTok) && !bAbort && Parse()) { eTok = Peek(); if( IsEof() ) @@ -73,8 +77,7 @@ void SbiParser::If() pCond.reset(); TestToken( THEN ); eTok = Peek(); - while( !( eTok == ELSEIF || eTok == ELSE || eTok == ENDIF ) && - !bAbort && Parse() ) + while (!EndsIfBranch(eTok) && !bAbort && Parse()) { eTok = Peek(); if( IsEof() )