use subList().clear instead of a loop of remove(0)
This commit is contained in:
parent
ba8a26705e
commit
e34ea727ca
|
@ -197,8 +197,8 @@ public class ListUnivariateImpl extends DescriptiveStatistics implements Seriali
|
|||
//Discard elements from the front of the list if the windowSize is less than
|
||||
// the size of the list.
|
||||
int extra = list.size() - windowSize;
|
||||
for (int i = 0; i < extra; i++) {
|
||||
list.remove(0);
|
||||
if (extra > 0) {
|
||||
list.subList(0, extra).clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue