Skip to content

Commit e4dafb5

Browse files
rouaultnyalldawson
authored andcommittedJun 15, 2020
qgstracer.cpp: fix warning about potentially uninitialized variable (likely false positive, but not so obvious)
1 parent 0d9e063 commit e4dafb5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎src/core/qgstracer.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,18 +278,17 @@ int point2vertex( const QgsTracerGraph &g, const QgsPointXY &pt, double epsilon
278278

279279
int point2edge( const QgsTracerGraph &g, const QgsPointXY &pt, int &lineVertexAfter, double epsilon = 1e-6 )
280280
{
281-
int vertexAfter;
282-
283281
for ( int i = 0; i < g.e.count(); ++i )
284282
{
285283
if ( g.inactiveEdges.contains( i ) )
286284
continue; // ignore temporarily disabled edges
287285

288286
const QgsTracerGraph::E &e = g.e.at( i );
287+
int vertexAfter = -1;
289288
double dist = closestSegment( e.coords, pt, vertexAfter, epsilon );
290289
if ( dist == 0 )
291290
{
292-
lineVertexAfter = vertexAfter; //NOLINT
291+
lineVertexAfter = vertexAfter;
293292
return i;
294293
}
295294
}

0 commit comments

Comments
 (0)
Please sign in to comment.