18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-21 09:44:59 +01:00

chore(editor): Fields: one identifier a statement, contains() for the sets (Sonar cpp:S1659, cpp:S6171)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ
This commit is contained in:
Claude
2026-11-12 22:41:31 +01:00
parent 59deddda6b
commit 6da461a976
2 changed files with 5 additions and 3 deletions

View File

@@ -54,13 +54,15 @@ void reach_of(heightmap::surface_patch const &Patch, glm::dvec2 &Low, glm::dvec2
// well: the separate fields left that overlap the closed outline are cut again (a cut leaves the holes there are as they are) // well: the separate fields left that overlap the closed outline are cut again (a cut leaves the holes there are as they are)
void recut_separate_over(terrain_streamer &Streamer, std::vector<heightmap::surface_patch> const &Patches, heightmap::surface_patch const &Closed) void recut_separate_over(terrain_streamer &Streamer, std::vector<heightmap::surface_patch> const &Patches, heightmap::surface_patch const &Closed)
{ {
glm::dvec2 low, high; glm::dvec2 low;
glm::dvec2 high;
Closed.bounds(low, high); Closed.bounds(low, high);
for (auto const &patch : Patches) for (auto const &patch : Patches)
{ {
if (patch.paint || patch.outline.size() < 3) if (patch.paint || patch.outline.size() < 3)
continue; continue;
glm::dvec2 otherlow, otherhigh; glm::dvec2 otherlow;
glm::dvec2 otherhigh;
patch.bounds(otherlow, otherhigh); patch.bounds(otherlow, otherhigh);
if (otherlow.x > high.x || otherhigh.x < low.x || otherlow.y > high.y || otherhigh.y < low.y) if (otherlow.x > high.x || otherhigh.x < low.x || otherlow.y > high.y || otherhigh.y < low.y)
continue; continue;

View File

@@ -921,7 +921,7 @@ bool terrain_streamer::waits_for_ground(heightmap::surface_patch const &Patch) c
for (auto x{std::min(first.first, last.first)}; x <= std::max(first.first, last.first); ++x) for (auto x{std::min(first.first, last.first)}; x <= std::max(first.first, last.first); ++x)
{ {
chunk_key const key{x, z}; chunk_key const key{x, z};
if (m_chunks.count(key) > 0 || m_removed.count(key) > 0) if (m_chunks.contains(key) || m_removed.contains(key))
continue; continue;
// still coming while its pack isn't read yet (just after opening the scenery none is); not coming only when // still coming while its pack isn't read yet (just after opening the scenery none is); not coming only when
// the pack is missing, or read and without that chunk // the pack is missing, or read and without that chunk