From 44e4bf36ec8c5346efa2e27b2cb369bf2a968c92 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Tue, 16 Jun 2015 20:11:58 -0700 Subject: [PATCH] Correct code that combined assignment with condition test. Combining assignment with an if() condition test is prone to errors in maintenance, triggers compile warnings and complicates debugging. Also fixed missing EOL at EOF. Change-Id: I6691fdc4de915c5c95d0fa58997398e6028beaa6 Signed-off-by: Jon A. Cruz Reviewed-on: https://gerrit.iotivity.org/gerrit/1290 Reviewed-by: Younghyun Joo Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- service/protocol-plugin/plugin-manager/src/Config.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/protocol-plugin/plugin-manager/src/Config.cpp b/service/protocol-plugin/plugin-manager/src/Config.cpp index 65062c0dc..9d8ec9b22 100644 --- a/service/protocol-plugin/plugin-manager/src/Config.cpp +++ b/service/protocol-plugin/plugin-manager/src/Config.cpp @@ -133,9 +133,9 @@ PMRESULT Config::parsing(char *xmlData, xml_document<> *doc) PMRESULT Config::getXmlData(xml_node<> *pluginInfo, std::string key) { - xml_attribute<> *iAttr = NULL; std::string value = ""; - if (iAttr = pluginInfo->first_attribute(key.c_str())) + xml_attribute<> *iAttr = pluginInfo->first_attribute(key.c_str()); + if (iAttr) { value = iAttr->value(); setValue(key, value); @@ -201,4 +201,4 @@ std::string Config::getPluginPath() { return ""; } -} \ No newline at end of file +} -- 2.34.1