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
|
// merge first part
|
||||||
if (commonStopFirst < commonStopSecond
|
if (commonStopFirst < commonStopSecond
|
||||||
|| (commonStopFirst == commonStopSecond && firstSegment.get(0).isMissingStop())) {
|
|| (commonStopFirst == commonStopSecond && firstSegment.get(0).isMissingStop())) {
|
||||||
for (int i = 0; i <= commonStopFirst; i++) {
|
firstSegment.subList(0, commonStopFirst + 1).clear();
|
||||||
firstSegment.remove(0);
|
|
||||||
}
|
|
||||||
for (int i = commonStopSecond; i >= 0; i--) {
|
for (int i = commonStopSecond; i >= 0; i--) {
|
||||||
firstSegment.add(0, segmentToMerge.get(i));
|
firstSegment.add(0, segmentToMerge.get(i));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue