Skip to content

Commit

Permalink
Also update when delays are different.
Browse files Browse the repository at this point in the history
  • Loading branch information
xivk committed Feb 27, 2019
1 parent 49fab36 commit ab0d166
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Itinero.Transit/Data/Database/ConnectionsDb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ internal uint AddOrUpdate((uint localTileId, uint localId) stop1,
var currentArrivalTime = (uint)reader.ArrivalTime;
var currentDepartureStop = reader.DepartureStop;
var currentArrivalStop = reader.ArrivalStop;
var currentDepartureDelay = reader.DepartureDelay;
var currentArrivalDelay = reader.ArrivalDelay;
var internalId = reader.Id;
reader = null; // don't use the reader, we will start modifying the data from this point on.

Expand Down Expand Up @@ -227,10 +229,15 @@ internal uint AddOrUpdate((uint localTileId, uint localId) stop1,
}
}
else
{ // timings have not changed but perhaps the stops (WHY? but let's implement this anyway)
if (currentDepartureStop != stop1 ||
{
if (currentDepartureDelay != departureDelay ||
currentArrivalDelay != arrivalDelay)
{ // perhaps delays are update but not the timings.
SetConnection(internalId, stop1, stop2, departureSeconds, travelTime, departureDelay, arrivalDelay);
}
else if (currentDepartureStop != stop1 ||
currentArrivalStop != stop2)
{
{ // timings have not changed but perhaps the stops (WHY? but let's implement this anyway)
SetConnection(internalId, stop1, stop2, departureSeconds, travelTime, departureDelay, arrivalDelay);
}
}
Expand Down

0 comments on commit ab0d166

Please sign in to comment.