use basic casts to prevent needless item upgrades #7738

This commit is contained in:
Thomas Krijnen
2026-03-06 16:34:12 +01:00
parent f9486be172
commit 0469a9528b
2 changed files with 9 additions and 15 deletions
+2 -2
View File
@@ -543,8 +543,8 @@ piecewise_function::const_ptr offset_function::get_offset() const { return offse
ifcopenshell::geometry::taxonomy::collection::ptr ifcopenshell::geometry::flatten(const taxonomy::collection::ptr& deep) {
auto flat = make<taxonomy::collection>();
ifcopenshell::geometry::visit<taxonomy::collection>(deep, [&flat](taxonomy::ptr i) {
flat->children.push_back(taxonomy::cast<taxonomy::geom_item>(clone(i)));
});
flat->children.push_back(std::static_pointer_cast<taxonomy::geom_item>(clone(i)));
});
return flat;
}