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