Remove incorrect operator!= for GncItem

It's better to use the default std::pair implementation

- spotted by clang-tidy bugprone-suspicious-string-compare
- will always return false, because type is the same

Also,
- remove redundant "using GncItem ..."
This commit is contained in:
Richard Cohen 2023-03-07 11:44:20 +00:00
parent b5f3f99035
commit 24f52d9b17

View File

@ -143,8 +143,6 @@ GncOptionGncOwnerValue::serialize() const noexcept
return retval;
}
using GncItem = std::pair<QofIdTypeConst, GncGUID>;
static GncItem
make_gnc_item(const QofInstance* inst)
{
@ -176,14 +174,6 @@ qof_instance_from_gnc_item(const GncItem& item)
return static_cast<QofInstance*>(qof_collection_lookup_entity(coll, &guid));
}
static bool
operator!=(const GncItem& left, const GncItem& right)
{
auto [ltype, lguid]{left};
auto [rtype, rguid]{right};
return strcmp(rtype, ltype) && !guid_equal(&rguid, &lguid);
}
GncOptionQofInstanceValue::GncOptionQofInstanceValue(
const char* section, const char* name,
const char* key, const char* doc_string,
@ -233,6 +223,12 @@ GncOptionQofInstanceValue::reset_default_value()
m_value = m_default_value;
}
static bool
operator==(const GncGUID& l, const GncGUID& r)
{
return guid_equal(&l, &r);
}
bool
GncOptionQofInstanceValue::is_changed() const noexcept
{
@ -447,12 +443,6 @@ GncOptionAccountListValue::get_default_value() const
return retval;
}
static bool
operator==(const GncGUID& l, const GncGUID& r)
{
return guid_equal(&l, &r);
}
bool
GncOptionAccountListValue::is_changed() const noexcept
{