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

This commit is contained in:
Benjamin Nauck
2025-05-03 22:19:51 +02:00
parent dd2172e463
commit 4bf7048534
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -189,7 +189,7 @@ bool ImpExpDxfRead::OnReadBlock(const std::string& name, int flags)
// and don't want to be complaining about unhandled entity types.
// Note that if it *is* for a hatch we could actually import it and use it to draw a hatch.
}
else if (Blocks.count(name) > 0) {
else if (Blocks.contains(name)) {
ImportError("Duplicate block name '%s'\n", name);
}
else {
+1 -1
View File
@@ -2689,7 +2689,7 @@ bool CDxfRead::ReadSection()
}
void CDxfRead::ProcessLayerReference(CDxfRead* object, void* target)
{
if (object->Layers.count(object->m_record_data) == 0) {
if (!object->Layers.contains(object->m_record_data)) {
object->ImportError("First reference to missing Layer '%s'", object->m_record_data);
// Synthesize the Layer so we don't get the same error again.
// We need to take copies of the string arguments because MakeLayer uses them as move