mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
b5f3f99035
commit
24f52d9b17
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user