App: use contains() instead of count() where possible

This commit is contained in:
Benjamin Nauck
2025-03-10 21:36:17 +01:00
parent d427162d97
commit 65ee1339de
8 changed files with 44 additions and 44 deletions

View File

@@ -581,7 +581,7 @@ bool _isInInListRecursive(const DocumentObject* act, const DocumentObject* check
bool DocumentObject::isInInListRecursive(DocumentObject* linkTo) const
{
return this == linkTo || getInListEx(true).count(linkTo);
return this == linkTo || getInListEx(true).contains(linkTo);
}
bool DocumentObject::isInInList(DocumentObject* linkTo) const
@@ -644,7 +644,7 @@ bool DocumentObject::testIfLinkDAGCompatible(const std::vector<DocumentObject*>&
auto inLists = getInListEx(true);
inLists.emplace(const_cast<DocumentObject*>(this));
for (auto obj : linksTo) {
if (inLists.count(obj)) {
if (inLists.contains(obj)) {
return false;
}
}