Skip to content

Commit

Permalink
FIX: NAV-160 - fix error: ‘stopNames’ was not declared in this scope
Browse files Browse the repository at this point in the history
  • Loading branch information
Brunner246 committed Aug 30, 2024
1 parent bad0e23 commit 051bd0a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/gtfsRaptorConfig/src/TimetableManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ namespace converter {
return data->stops | std::views::filter([&aStopName](const auto& stop) { return stop.second.stopName == aStopName; })
| std::views::keys | std::ranges::to<std::vector<std::string>>();
#else
std::vector<std::string> stopNames;
auto filteredStops = data->stops
| std::views::filter([&aStopName](const auto& stop) { return stop.second.stopName == aStopName; });
| std::views::filter([&aStopName](const auto& stop) { return stop.second.stopName == aStopName; });
std::ranges::transform(filteredStops, std::back_inserter(stopNames), [](const auto& stop) {
return stop.first;
});
return filteredStops;
return stopNames;
#endif
}
const schedule::gtfs::StopTime& TimetableManager::getStopTimeFromStopId(std::string const& aStopId) const
Expand Down Expand Up @@ -162,16 +163,15 @@ namespace converter {
| std::ranges::to<std::vector<schedule::gtfs::StopTime>>();
#else
std::vector<schedule::gtfs::StopTime> stopTimesFiltered;
std::ranges::transform(data->stopTimes.at(aStopId), std::back_inserter(stopTimesFiltered), [secondsGreaterThan](const schedule::gtfs::StopTime& stopTime) {
if (stopTime.departureTime.toSeconds() > secondsGreaterThan) {
auto departureTimeGreaterThan = [secondsGreaterThan](const schedule::gtfs::StopTime& stopTime) {
return stopTime.departureTime.toSeconds() > secondsGreaterThan;
};
std::ranges::transform(data->stopTimes.at(aStopId) | std::views::filter(departureTimeGreaterThan), std::back_inserter(stopTimesFiltered), [secondsGreaterThan](const schedule::gtfs::StopTime& stopTime) {
return stopTime;
}
return schedule::gtfs::StopTime{};
});
stopTimesFiltered.erase(std::remove_if(stopTimesFiltered.begin(), stopTimesFiltered.end(), [](const schedule::gtfs::StopTime& stopTime) {
return stopTime.tripId.empty();
}),
stopTimesFiltered.end());
std::erase_if(stopTimesFiltered, [](const schedule::gtfs::StopTime& stopTime) {
return stopTime.tripId.empty();
});
return stopTimesFiltered;
#endif
}
Expand Down

0 comments on commit 051bd0a

Please sign in to comment.