App: use contains() instead of count()
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user