Gui: use contains() and isEmpty() instead of count() where possible
This commit is contained in:
@@ -1047,7 +1047,7 @@ void Document::slotChangedObject(const App::DocumentObject& Obj, const App::Prop
|
||||
&& (Prop.isDerivedFrom<App::PropertyPlacement>()
|
||||
// Issue ID 0004230 : getName() can return null in which case strstr() crashes
|
||||
|| (Prop.getName() && strstr(Prop.getName(),"Scale")))
|
||||
&& d->_editObjs.count(&Obj))
|
||||
&& d->_editObjs.contains(&Obj))
|
||||
{
|
||||
Base::Matrix4D mat;
|
||||
auto sobj = d->_editViewProviderParent->getObject()->getSubObject(
|
||||
@@ -1294,7 +1294,7 @@ static bool checkCanonicalPath(const std::map<App::Document*, bool> &docs)
|
||||
auto &d = paths[info.canonicalFilePath()];
|
||||
d.push_back(doc);
|
||||
if (!warn && d.size() > 1) {
|
||||
if (docs.count(d.front()) || docs.count(d.back()))
|
||||
if (docs.contains(d.front()) || docs.contains(d.back()))
|
||||
warn = true;
|
||||
}
|
||||
}
|
||||
@@ -1315,7 +1315,7 @@ static bool checkCanonicalPath(const std::map<App::Document*, bool> &docs)
|
||||
for (auto &v : paths) {
|
||||
if (v.second.size() <= 1) continue;
|
||||
for (auto doc : v.second) {
|
||||
if (docs.count(doc)) {
|
||||
if (docs.contains(doc)) {
|
||||
FC_WARN("Physical path: " << v.first.toUtf8().constData());
|
||||
for (auto d : v.second)
|
||||
FC_WARN(" Document: " << docName(d).toUtf8().constData()
|
||||
|
||||
Reference in New Issue
Block a user