From 2e2d736ccbb21daae91603732c87d5375ede1b47 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 6 Nov 2018 13:27:23 +0200 Subject: loplugin:collapseif in framework..sal Change-Id: I3068b18f5cff024a48a8f8c68d69cadad30fe4d5 Reviewed-on: https://gerrit.libreoffice.org/62953 Tested-by: Jenkins Reviewed-by: Noel Grandin --- registry/source/registry.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'registry/source') diff --git a/registry/source/registry.cxx b/registry/source/registry.cxx index 61b2c7ba1445..b183f634eb97 100644 --- a/registry/source/registry.cxx +++ b/registry/source/registry.cxx @@ -57,13 +57,10 @@ static void REGISTRY_CALLTYPE release(RegHandle hReg) { ORegistry* pReg = static_cast(hReg); - if (pReg) + if (pReg && pReg->release() == 0) { - if (pReg->release() == 0) - { - delete pReg; - hReg = nullptr; - } + delete pReg; + hReg = nullptr; } } -- cgit