Material: use contains() and isEmpty() instead of count() where possible

# Conflicts:
#	src/Mod/Material/App/ModelLibrary.cpp
This commit is contained in:
Benjamin Nauck
2025-03-12 15:59:55 +01:00
parent 4bf7048534
commit e69c372056
4 changed files with 7 additions and 7 deletions

View File

@@ -92,7 +92,7 @@ MaterialLibrary::getMaterialTree(const std::shared_ptr<Materials::MaterialFilter
for (auto& itp : list) {
if (!itp.isEmpty()) {
// Add the folder only if it's not already there
if (node->count(itp) == 0) {
if (!node->contains(itp)) {
auto mapPtr = std::make_shared<
std::map<QString, std::shared_ptr<MaterialTreeNode>>>();
std::shared_ptr<MaterialTreeNode> child =
@@ -125,7 +125,7 @@ MaterialLibrary::getMaterialTree(const std::shared_ptr<Materials::MaterialFilter
// auto node = materialTree;
// for (auto& itp : list) {
// // Add the folder only if it's not already there
// if (node->count(itp) == 0) {
// if (!node->contains(itp)) {
// std::shared_ptr<std::map<QString, std::shared_ptr<MaterialTreeNode>>>
// mapPtr = std::make_shared<
// std::map<QString, std::shared_ptr<MaterialTreeNode>>>();