Remove `subList` check or make it smarter
Luro02 opened this issue · 1 comments
Luro02 commented
Description
The current implementation isn't any better than using a for-loop. Maybe only suggest this as an extension to .addAll
? Like here:
for (int i = start; i < end; i++) {
result.add(list.get(i));
}
// -> replace with result.addAll(list.subList(start, end));
Luro02 commented
One use for sublist is when one can replace the entire loop with a single subList expression