@@ -21,7 +21,6 @@ namespace TrRouting
21
21
short connectionMinWaitingTimeSeconds {-1 };
22
22
// long long footpathsRangeStart {-1};
23
23
// long long footpathsRangeEnd {-1};
24
- int footpathIndex {-1 };
25
24
int footpathTravelTime {-1 };
26
25
int footpathDistance {-1 };
27
26
int tentativeEgressNodeArrivalTime {MAX_INT};
@@ -110,7 +109,6 @@ namespace TrRouting
110
109
tentativeEgressNodeArrivalTime = connectionArrivalTime;
111
110
}
112
111
113
- footpathIndex = 0 ;
114
112
for (const NodeTimeDistance & transferableNode : nodeArrival.transferableNodes )
115
113
{
116
114
// Extract tentative time for current transferable node if found
@@ -119,18 +117,17 @@ namespace TrRouting
119
117
if (nodeArrival != transferableNode.node &&
120
118
currentTransferablenNodesTentativeTime < connectionArrivalTime)
121
119
{
122
- footpathIndex++;
123
120
continue ;
124
121
}
125
122
126
123
// TODO We should not do a direct == with float values
127
- footpathTravelTime = parameters.getWalkingSpeedFactor () == 1.0 ? nodeArrival. transferableNodes [footpathIndex]. time : (int )ceil ((float )nodeArrival. transferableNodes [footpathIndex] .time / parameters.getWalkingSpeedFactor ());
124
+ footpathTravelTime = parameters.getWalkingSpeedFactor () == 1.0 ? transferableNode. time : (int )ceil ((float )transferableNode .time / parameters.getWalkingSpeedFactor ());
128
125
129
126
if (footpathTravelTime <= parameters.getMaxTransferWalkingTravelTimeSeconds ())
130
127
{
131
128
if (footpathTravelTime + connectionArrivalTime < currentTransferablenNodesTentativeTime)
132
129
{
133
- footpathDistance = nodeArrival. transferableNodes [footpathIndex] .distance ;
130
+ footpathDistance = transferableNode .distance ;
134
131
nodesTentativeTime[transferableNode.node .uid ] = footpathTravelTime + connectionArrivalTime;
135
132
136
133
// TODO DO we need a make_optional here??
@@ -148,11 +145,10 @@ namespace TrRouting
148
145
)
149
146
)
150
147
{
151
- footpathDistance = nodeArrival. transferableNodes [footpathIndex] .distance ;
148
+ footpathDistance = transferableNode .distance ;
152
149
forwardEgressJourneysSteps.insert_or_assign (transferableNode.node .uid , JourneyStep (currentTripQueryOverlay.enterConnection , *connection, std::cref (trip), footpathTravelTime, true , footpathDistance));
153
150
}
154
151
}
155
- footpathIndex++;
156
152
}
157
153
}
158
154
reachableConnectionsCount++;
@@ -212,7 +208,6 @@ namespace TrRouting
212
208
short connectionMinWaitingTimeSeconds {-1 };
213
209
// long long footpathsRangeStart {-1};
214
210
// long long footpathsRangeEnd {-1};
215
- int footpathIndex {-1 };
216
211
int footpathTravelTime {-1 };
217
212
int footpathDistance {-1 };
218
213
bool nodeWasAccessedFromOrigin {false };
@@ -286,7 +281,6 @@ namespace TrRouting
286
281
const Node &nodeArrival = (*connection).get ().getArrivalNode ();
287
282
connectionArrivalTime = (*connection).get ().getArrivalTime ();
288
283
289
- footpathIndex = 0 ;
290
284
for (const NodeTimeDistance & transferableNode : nodeArrival.transferableNodes )
291
285
{
292
286
// Extract tentative time for current transferable node if found
@@ -295,18 +289,17 @@ namespace TrRouting
295
289
if (nodeArrival != transferableNode.node &&
296
290
currentTransferablenNodesTentativeTime < connectionArrivalTime)
297
291
{
298
- footpathIndex++;
299
292
continue ;
300
293
}
301
294
302
295
// TODO We should not do a direct == with float values
303
- footpathTravelTime = parameters.getWalkingSpeedFactor () == 1.0 ? nodeArrival. transferableNodes [footpathIndex]. time : (int )ceil ((float )nodeArrival. transferableNodes [footpathIndex] .time / parameters.getWalkingSpeedFactor ());
296
+ footpathTravelTime = parameters.getWalkingSpeedFactor () == 1.0 ? transferableNode. time : (int )ceil ((float )transferableNode .time / parameters.getWalkingSpeedFactor ());
304
297
305
298
if (footpathTravelTime <= parameters.getMaxTransferWalkingTravelTimeSeconds ())
306
299
{
307
300
if (footpathTravelTime + connectionArrivalTime < currentTransferablenNodesTentativeTime)
308
301
{
309
- footpathDistance = nodeArrival. transferableNodes [footpathIndex] .distance ;
302
+ footpathDistance = transferableNode .distance ;
310
303
nodesTentativeTime[transferableNode.node .uid ] = footpathTravelTime + connectionArrivalTime;
311
304
312
305
// TODO DO we need a make_optional here??
@@ -324,11 +317,10 @@ namespace TrRouting
324
317
)
325
318
)
326
319
{
327
- footpathDistance = nodeArrival. transferableNodes [footpathIndex] .distance ;
320
+ footpathDistance = transferableNode .distance ;
328
321
forwardEgressJourneysSteps.insert_or_assign (transferableNode.node .uid , JourneyStep (currentTripQueryOverlay.enterConnection , *connection, std::cref (trip), footpathTravelTime, true , footpathDistance));
329
322
}
330
323
}
331
- footpathIndex++;
332
324
}
333
325
}
334
326
reachableConnectionsCount++;
0 commit comments