use of org.eclipse.collections.api.set.primitive.MutableBooleanSet in project eclipse-collections by eclipse.
the class BooleanArrayList method distinct.
/**
* @since 6.0
*/
@Override
public MutableBooleanList distinct() {
BooleanArrayList target = new BooleanArrayList();
MutableBooleanSet seenSoFar = new BooleanHashSet();
for (int i = 0; i < this.size; i++) {
boolean each = this.get(i);
if (seenSoFar.add(each)) {
target.add(each);
}
}
return target;
}
Aggregations