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

Julien Nabet serval2412 at yahoo.fr
Sun Dec 20 13:18:51 PST 2015


 basic/source/comp/dim.cxx |   15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

New commits:
commit 36984c75ccecc989ded8287647b6b10a72413cb7
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Dec 20 22:17:36 2015 +0100

    cppcheck: false positive deallocuse
    
    Help cppcheck by returning early and remove a now useless bool var
    
    Change-Id: If4dcb6f64bcfd6c3cb22136163caf3679d6fd5a8

diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx
index fdca04d..238aa24 100644
--- a/basic/source/comp/dim.cxx
+++ b/basic/source/comp/dim.cxx
@@ -1206,16 +1206,13 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate )
     SbiSymDef* pOld = aPublics.Find( pDef->GetName() );
     if( pOld )
     {
-        bool bError_ = false;
-
         pProc = pOld->GetProcDef();
         if( !pProc )
         {
             // Declared as a variable
             Error( ERRCODE_BASIC_BAD_DECLARATION, pDef->GetName() );
             delete pDef;
-            pProc = nullptr;
-            bError_ = true;
+            return;
         }
         // #100027: Multiple declaration -> Error
         // #112787: Not for setup, REMOVE for 8
@@ -1226,16 +1223,12 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate )
             {
                 Error( ERRCODE_BASIC_PROC_DEFINED, pDef->GetName() );
                 delete pDef;
-                pProc = nullptr;
-                bError_ = true;
+                return;
             }
         }
 
-        if( !bError_ )
-        {
-            pDef->Match( pProc );
-            pProc = pDef;
-        }
+        pDef->Match( pProc );
+        pProc = pDef;
     }
     else
     {


More information about the Libreoffice-commits mailing list