From f9473e8afcb624cc1b101195bf15943ec372b56f Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Mon, 6 May 2024 16:52:34 +0200 Subject: secondlife/viewer#1333 BOOL to bool conversion leftovers: ternaries --- indra/llxml/llcontrol.cpp | 12 ++++++------ indra/llxml/llxmltree.cpp | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'indra/llxml') diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 6b7f63c192..952ad3e8cd 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -210,7 +210,7 @@ LLSD LLControlVariable::getComparableValue(const LLSD& value) void LLControlVariable::setValue(const LLSD& new_value, bool saved_value) { - if (mValidateSignal(this, new_value) == false) + if (!mValidateSignal(this, new_value)) { // can not set new value, exit return; @@ -218,12 +218,12 @@ void LLControlVariable::setValue(const LLSD& new_value, bool saved_value) LLSD storable_value = getComparableValue(new_value); LLSD original_value = getValue(); - bool value_changed = llsd_compare(original_value, storable_value) == false; + bool value_changed = !llsd_compare(original_value, storable_value); if(saved_value) { // If we're going to save this value, return to default but don't fire resetToDefault(false); - if (llsd_compare(mValues.back(), storable_value) == false) + if (!llsd_compare(mValues.back(), storable_value)) { mValues.push_back(storable_value); } @@ -233,7 +233,7 @@ void LLControlVariable::setValue(const LLSD& new_value, bool saved_value) // This is an unsaved value. Its needs to reside at // mValues[2] (or greater). It must not affect // the result of getSaveValue() - if (llsd_compare(mValues.back(), storable_value) == false) + if (!llsd_compare(mValues.back(), storable_value)) { while(mValues.size() > 2) { @@ -267,10 +267,10 @@ void LLControlVariable::setDefaultValue(const LLSD& value) LLSD comparable_value = getComparableValue(value); LLSD original_value = getValue(); - bool value_changed = (llsd_compare(original_value, comparable_value) == false); + bool value_changed = !llsd_compare(original_value, comparable_value); resetToDefault(false); mValues[0] = comparable_value; - if(value_changed) + if (value_changed) { firePropertyChanged(original_value); } diff --git a/indra/llxml/llxmltree.cpp b/indra/llxml/llxmltree.cpp index 38321847c3..0c1615f486 100644 --- a/indra/llxml/llxmltree.cpp +++ b/indra/llxml/llxmltree.cpp @@ -155,14 +155,14 @@ void LLXmlTreeNode::dump( const std::string& prefix ) bool LLXmlTreeNode::hasAttribute(const std::string& name) { - LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); + LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString(name); attribute_map_t::iterator iter = mAttributes.find(canonical_name); - return (iter == mAttributes.end()) ? false : true; + return iter != mAttributes.end(); } void LLXmlTreeNode::addAttribute(const std::string& name, const std::string& value) { - LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); + LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString(name); const std::string *newstr = new std::string(value); mAttributes[canonical_name] = newstr; // insert + copy } -- cgit v1.2.3