Skip to content
Permalink
Browse files
Unreachable pt 2
  • Loading branch information
nyalldawson committed Nov 9, 2021
1 parent ebef533 commit fe896e3e50331417f24339945c426ee2fb5de634
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/analysis/network/qgsgraph.cpp
@@ -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 )
@@ -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 )

0 comments on commit fe896e3

Please sign in to comment.