App: use contains() instead of count()

This commit is contained in:
Benjamin Nauck
2025-05-03 22:22:10 +02:00
parent ae76f89759
commit 04ac555ae4
2 changed files with 10 additions and 0 deletions
+6
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(),
+4
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)