From d6ce9c5f4f4ff0a9ed5af4fa3cdad4eeeec2d611 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 15 Aug 2024 13:40:19 -0400 Subject: [PATCH] refactor(StatesToWalkStepMapper): Reuse hasProfileCost check. --- .../routing/algorithm/mapping/StatesToWalkStepsMapper.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/org/opentripplanner/routing/algorithm/mapping/StatesToWalkStepsMapper.java b/src/main/java/org/opentripplanner/routing/algorithm/mapping/StatesToWalkStepsMapper.java index df4c54d0302..d5b8b31efce 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/mapping/StatesToWalkStepsMapper.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/mapping/StatesToWalkStepsMapper.java @@ -200,10 +200,7 @@ private void processState(State backState, State forwardState) { // G-MAP-specific: Overwrite the name on short street edges so they are merged with longer street // sections to clean up turn-by-turn instructions. - if ( - edge instanceof StreetEdge streetEdge && - streetEdge.profileCost != null && !streetEdge.profileCost.isEmpty() - ) { + if (edge instanceof StreetEdge streetEdge && streetEdge.hasProfileCost()) { if (shouldOverwriteCurrentDirectionText(edge, direction)) { // HACK: If the instruction is "continue", the current street name is bogus and its length is very short (< 10 meters) // but not the next edge one, use the next street name and don't start a new step.