Skip to content

Commit 454255a

Browse files
authored
๐Ÿ› fix : ์ตœ์  ๊ฒฝ๋กœ ์ง์„  ๊ตฌ๊ฐ„ ์ˆ˜์ •
๐Ÿ› fix : ์ตœ์  ๊ฒฝ๋กœ ์ง์„  ๊ตฌ๊ฐ„ ์ˆ˜์ •
2 parents f3e72c5 + 934cddd commit 454255a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

โ€Žsrc/main/java/com/example/Centralthon/domain/route/algo/PathStitcher.javaโ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import lombok.NoArgsConstructor;
77

88
import java.util.ArrayList;
9+
import java.util.Collections;
910
import java.util.List;
1011
import java.util.Map;
1112

@@ -23,6 +24,12 @@ public static CombinedPath stitch(List<Integer> order, Map<SegmentKey, PedSegmen
2324
if (seg == null) throw new RouteSegmentMissingException();
2425

2526
List<LocationRes> p = seg.path();
27+
28+
if (i > j && p != null && p.size() >= 2) {
29+
p = new ArrayList<>(p);
30+
Collections.reverse(p);
31+
}
32+
2633
if (merged.isEmpty()) merged.addAll(p);
2734
else {
2835
if (!p.isEmpty() && !merged.isEmpty()

0 commit comments

Comments
ย (0)