l10ntools/source/helpmerge.cxx |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 4c7332e5f439774363f29cc7d47494854cc981f5
Author:     Dr. David Alan Gilbert <d...@treblig.org>
AuthorDate: Sun Jan 24 19:01:34 2021 +0000
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Jan 30 08:12:47 2021 +0100

    HelpParser::ProcessHelp: Tidy Null checks
    
    cppcheck spotted a repeated nullptr pair of if's near
    the start that can be squashed.
    Those gurantee that later pXMLElement is non-null, so
    we don't need the test later.
    
    Change-Id: Ie8fc24490ef031416709d55e6fbdd99e9853c4f8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110157
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx
index e1beff7a5da4..8fed8ffcb452 100644
--- a/l10ntools/source/helpmerge.cxx
+++ b/l10ntools/source/helpmerge.cxx
@@ -200,9 +200,8 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , const 
OString& sCur , ResDa
     if( pXMLElement == nullptr )
     {
         printf("Error: Can't find en-US entry\n");
-    }
-    if( pXMLElement == nullptr )
         return;
+    }
 
     OString sNewText;
     OString sNewdata;
@@ -239,13 +238,10 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , 
const OString& sCur , ResDa
     }
     if (!sNewdata.isEmpty())
     {
-        if( pXMLElement != nullptr )
-        {
-            XMLData *data = new XMLData( sNewdata , nullptr ); // Add new one
-            pXMLElement->RemoveAndDeleteAllChildren();
-            pXMLElement->AddChild( data );
-            aLangHM->erase( sCur );
-        }
+        XMLData *data = new XMLData( sNewdata , nullptr ); // Add new one
+        pXMLElement->RemoveAndDeleteAllChildren();
+        pXMLElement->AddChild( data );
+        aLangHM->erase( sCur );
     }
     else
     {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to