From 2a5e42e359aea9aef7b2832f5779a20d35b8e503 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Tue, 11 Jun 2024 20:09:27 +0200 Subject: [PATCH] Don't log 'no op defined' for failed conversions --- src/ifcgeom/mapping/bind_convert_impl.i | 1 + src/ifcgeom/mapping/mapping.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ifcgeom/mapping/bind_convert_impl.i b/src/ifcgeom/mapping/bind_convert_impl.i index 16f27db4f2..fa440f46f3 100644 --- a/src/ifcgeom/mapping/bind_convert_impl.i +++ b/src/ifcgeom/mapping/bind_convert_impl.i @@ -4,6 +4,7 @@ #define BIND(T) \ if (!item && inst->as()) { \ + matched = true; \ try { \ item = map_impl(inst->as()); \ if (item != nullptr) { \ diff --git a/src/ifcgeom/mapping/mapping.cpp b/src/ifcgeom/mapping/mapping.cpp index 5741d48bbb..f92d7ca7e2 100644 --- a/src/ifcgeom/mapping/mapping.cpp +++ b/src/ifcgeom/mapping/mapping.cpp @@ -547,12 +547,15 @@ taxonomy::ptr mapping::map(const IfcBaseInterface* inst) { // of if-statements and whether a switch on e.g inst->declaration()->index_in_schema() // isn't more efficient (which would disable inheritance though). + bool matched = false; + #include "bind_convert_impl.i" - if (use_caching_ && item) { - cache_.insert({ iden, item }); - } - else { + if (item) { + if (use_caching_) { + cache_.insert({ iden, item }); + } + } else if (!matched) { Logger::Message(Logger::LOG_ERROR, "No operation defined for:", inst); } return item;