From 1511c73aa415c22dd890f2a8a3bc6d25dd646f8d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 3 Apr 2020 10:50:28 +0200 Subject: [PATCH] loplugin:flatten in opencl Change-Id: I9f45510eddb022013af751d232d4704432717ef6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91617 Tested-by: Jenkins Reviewed-by: Noel Grandin --- opencl/source/OpenCLZone.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/opencl/source/OpenCLZone.cxx b/opencl/source/OpenCLZone.cxx index 43ac31899c4d..01b50ed14a54 100644 --- a/opencl/source/OpenCLZone.cxx +++ b/opencl/source/OpenCLZone.cxx @@ -25,21 +25,21 @@ void OpenCLZone::hardDisable() { // protect ourselves from double calling etc. static bool bDisabled = false; - if (!bDisabled) - { - bDisabled = true; + if (bDisabled) + return; - std::shared_ptr xChanges(comphelper::ConfigurationChanges::create()); - officecfg::Office::Common::Misc::UseOpenCL::set(false, xChanges); - xChanges->commit(); + bDisabled = true; - // Force synchronous config write - auto xConfProvider = css::configuration::theDefaultProvider::get(comphelper::getProcessComponentContext()); - css::uno::Reference xFlushable(xConfProvider, css::uno::UNO_QUERY_THROW); - xFlushable->flush(); + std::shared_ptr xChanges(comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Misc::UseOpenCL::set(false, xChanges); + xChanges->commit(); - releaseOpenCLEnv(&openclwrapper::gpuEnv); - } + // Force synchronous config write + auto xConfProvider = css::configuration::theDefaultProvider::get(comphelper::getProcessComponentContext()); + css::uno::Reference xFlushable(xConfProvider, css::uno::UNO_QUERY_THROW); + xFlushable->flush(); + + releaseOpenCLEnv(&openclwrapper::gpuEnv); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */