return new SlicedOpenBitSet(allocation.getData(), allocation.getOffset(), (OpenBitSet) set);
} else if (set instanceof OpenBitDocSet) {
return new SlicedOpenBitSet(allocation.getData(), allocation.getOffset(), ((OpenBitDocSet) set).set());
} else {
SlicedOpenBitSet slicedSet = new SlicedOpenBitSet(allocation.getData(), numOfWords, allocation.getOffset());
slicedSet.fastSet(doc); // we already have an open iterator, so use it, and don't forget to set the initial one
while ((doc = it.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
slicedSet.fastSet(doc);
}
return slicedSet;
}