Navigation Menu

Skip to content

Commit

Permalink
Unreachable pt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 9, 2021
1 parent ebef533 commit fe896e3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/analysis/network/qgsgraph.cpp
Expand Up @@ -50,7 +50,9 @@ const QgsGraphVertex &QgsGraph::vertex( int idx ) const
if ( it != mGraphVertices.constEnd() )
return ( it ).value();
Q_ASSERT_X( false, "QgsGraph::vertex()", "Invalid vertex ID" );
BUILTIN_UNREACHABLE

// unreachable...
return ( *const_cast< QHash<int, QgsGraphVertex>* >( &mGraphVertices ) )[ idx ];
}

void QgsGraph::removeVertex( int index )
Expand All @@ -77,7 +79,10 @@ const QgsGraphEdge &QgsGraph::edge( int idx ) const
if ( it != mGraphEdges.constEnd() )
return ( it ).value();
Q_ASSERT_X( false, "QgsGraph::edge()", "Invalid edge ID" );
BUILTIN_UNREACHABLE

// unreachable...
return ( *const_cast< QHash<int, QgsGraphEdge>* >( &mGraphEdges ) )[ idx ];

}

void QgsGraph::removeEdge( int index )
Expand Down

0 comments on commit fe896e3

Please sign in to comment.