Skip to content

Commit

Permalink
refactor(editor): remove service id filter param from normalize stop …
Browse files Browse the repository at this point in the history
…times
  • Loading branch information
landonreed committed Mar 29, 2019
1 parent bde91b8 commit 2e4dd3a
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/main/java/com/conveyal/gtfs/loader/JdbcTableWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public int normalizeStopTimesForPattern (int id, int beginWithSequence) throws S
patternStopsToNormalize.add(patternStop);
}
}
int stopTimesUpdated = updateStopTimesForPatternStops(patternStopsToNormalize, null);
int stopTimesUpdated = updateStopTimesForPatternStops(patternStopsToNormalize);
connection.commit();
return stopTimesUpdated;
} catch (Exception e) {
Expand Down Expand Up @@ -707,10 +707,11 @@ private int updateStopTimesForPatternStop(ObjectNode patternStop, int previousTr
* departure times for existing trips after a pattern stop has been added or inserted into a pattern or if a
* pattern stop's default travel or dwell time were updated and the stop times need to reflect this update.
* @param patternStops list of pattern stops for which to update stop times (ordered by increasing stop_sequence)
* @param serviceIdFilters service_id values to filter trips on
* @throws SQLException
*
* TODO? add param Set<String> serviceIdFilters service_id values to filter trips on
*/
private int updateStopTimesForPatternStops(List<PatternStop> patternStops, Set<String> serviceIdFilters) throws SQLException {
private int updateStopTimesForPatternStops(List<PatternStop> patternStops) throws SQLException {
PatternStop firstPatternStop = patternStops.iterator().next();
int firstStopSequence = firstPatternStop.stop_sequence;
// Prepare SQL query to determine the time that should form the basis for adding the travel time values.
Expand All @@ -724,12 +725,6 @@ private int updateStopTimesForPatternStops(List<PatternStop> patternStops, Set<S
tablePrefix,
tablePrefix
);
if (serviceIdFilters != null && serviceIdFilters.size() > 0) {
getFirstTravelTimeSql += String.format(
" and t.service_id in (%s)",
Collections.nCopies(serviceIdFilters.size(), "?")
);
}
PreparedStatement statement = connection.prepareStatement(getFirstTravelTimeSql);
statement.setInt(1, previousStopSequence);
statement.setString(2, firstPatternStop.pattern_id);
Expand Down

0 comments on commit 2e4dd3a

Please sign in to comment.