Performance: 'List.remove()' called in loop
This commit is contained in:
parent
6b16170168
commit
901827458f
1 changed files with 1 additions and 3 deletions
|
@ -325,9 +325,7 @@ public class TransportStopsRouteReader {
|
|||
// merge first part
|
||||
if (commonStopFirst < commonStopSecond
|
||||
|| (commonStopFirst == commonStopSecond && firstSegment.get(0).isMissingStop())) {
|
||||
for (int i = 0; i <= commonStopFirst; i++) {
|
||||
firstSegment.remove(0);
|
||||
}
|
||||
firstSegment.subList(0, commonStopFirst + 1).clear();
|
||||
for (int i = commonStopSecond; i >= 0; i--) {
|
||||
firstSegment.add(0, segmentToMerge.get(i));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue