Skip to content

Commit f5f7825

Browse files
committed
Forbid self-loops in importOSMEdges
1 parent 76b2d01 commit f5f7825

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/dsm/dsm.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
static constexpr uint8_t DSM_VERSION_MAJOR = 2;
88
static constexpr uint8_t DSM_VERSION_MINOR = 3;
9-
static constexpr uint8_t DSM_VERSION_PATCH = 11;
9+
static constexpr uint8_t DSM_VERSION_PATCH = 12;
1010

1111
static auto const DSM_VERSION =
1212
std::format("{}.{}.{}", DSM_VERSION_MAJOR, DSM_VERSION_MINOR, DSM_VERSION_PATCH);

src/dsm/sources/Graph.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,12 @@ namespace dsm {
400400
if (!m_nodeMapping.contains(targetId)) {
401401
Logger::error(std::format("Node with id {} not found.", targetId));
402402
}
403+
if (sourceId == targetId) {
404+
Logger::warning(std::format("Self loop detected: {}->{}. Skipping.",
405+
sourceId,
406+
targetId));
407+
continue;
408+
}
403409
auto const srcId{m_nodeMapping.at(sourceId)};
404410
auto const dstId{m_nodeMapping.at(targetId)};
405411
if (static_cast<unsigned long long>(srcId * nNodes + dstId) >

0 commit comments

Comments
 (0)