fix: step_import — use find/insert_or_assign for unordered_map of non-default-constructible types
CI / Build & Test (push) Failing after 34s
CI / Release Build (push) Failing after 31s

This commit is contained in:
茂之钳
2026-07-24 06:21:25 +00:00
parent 38098ad3f9
commit 7099d8d502
+6 -4
View File
@@ -1225,7 +1225,8 @@ private:
}
curves::NurbsCurve get_or_build_curve(int ref) {
if (curve_cache_.count(ref)) return curve_cache_[ref];
auto cit = curve_cache_.find(ref);
if (cit != curve_cache_.end()) return cit->second;
if (!entities_.count(ref)) {
// Return a dummy curve
return curves::NurbsCurve({Point3D(0,0,0), Point3D(1,0,0)}, {0,0,1,1}, {1,1}, 1);
@@ -1251,12 +1252,13 @@ private:
set_error(StepError::EntityTypeError, "Error building curve #" + std::to_string(ref) + ": " + e.what());
nc = curves::NurbsCurve({Point3D(0,0,0), Point3D(1,0,0)}, {0,0,1,1}, {1,1}, 1);
}
curve_cache_[ref] = nc;
curve_cache_.insert_or_assign(ref, nc);
return nc;
}
curves::NurbsSurface get_or_build_surface(int ref) {
if (surface_cache_.count(ref)) return surface_cache_[ref];
auto sit = surface_cache_.find(ref);
if (sit != surface_cache_.end()) return sit->second;
if (!entities_.count(ref)) {
// Return a dummy surface
std::vector<std::vector<Point3D>> g = {{Point3D(0,0,0), Point3D(1,0,0)},
@@ -1293,7 +1295,7 @@ private:
{Point3D(0,1,0), Point3D(1,1,0)}};
ns = curves::NurbsSurface(g, {0,0,1,1}, {0,0,1,1}, {}, 1, 1);
}
surface_cache_[ref] = ns;
surface_cache_.insert_or_assign(ref, ns);
return ns;
}