From 327cbe6eb4b69098ffe51c9a16791737831e7dd1 Mon Sep 17 00:00:00 2001 From: pankore <86098180+pankore@users.noreply.github.com> Date: Thu, 25 Nov 2021 20:06:56 +0800 Subject: [PATCH] Correct usage of ConfigValueExists --- src/platform/Ameba/AmebaConfig.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/platform/Ameba/AmebaConfig.cpp b/src/platform/Ameba/AmebaConfig.cpp index cf7bdf87faa65b..ba2a27f1010117 100644 --- a/src/platform/Ameba/AmebaConfig.cpp +++ b/src/platform/Ameba/AmebaConfig.cpp @@ -251,17 +251,7 @@ CHIP_ERROR AmebaConfig::ClearConfigValue(Key key) bool AmebaConfig::ConfigValueExists(Key key) { - int32_t exist; - CHIP_ERROR err; - - exist = checkExist(key.Namespace, key.Name); - - if (exist == 1) - err = CHIP_NO_ERROR; - else - err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND; - - return (err == CHIP_NO_ERROR); + return checkExist(key.Namespace, key.Name); } CHIP_ERROR AmebaConfig::EnsureNamespace(const char * ns)