App: use contains() instead of count()

This commit is contained in:
Benjamin Nauck
2025-03-28 16:51:36 +01:00
parent ae76f89759
commit 04ac555ae4
2 changed files with 10 additions and 0 deletions

View File

@@ -256,9 +256,15 @@ bool DynamicProperty::addProperty(Property* prop)
return false;
}
auto& index = props.get<0>();
#if BOOST_VERSION < 107500
if (index.count(prop->getName())) {
return false;
}
#else
if (index.contains(prop->getName())) {
return false;
}
#endif
index.emplace(prop,
std::string(),
prop->getName(),

View File

@@ -141,7 +141,11 @@ bool Transaction::isEmpty() const
bool Transaction::hasObject(const TransactionalObject* Obj) const
{
#if BOOST_VERSION < 107500
return !!_Objects.get<1>().count(Obj);
#else
return !!_Objects.get<1>().contains(Obj);
#endif
}
void Transaction::addOrRemoveProperty(TransactionalObject* Obj, const Property* pcProp, bool add)