Skip to content

Commit

Permalink
try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
nik9000 committed Oct 28, 2023
1 parent 76688ee commit 234521b
Showing 1 changed file with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,28 +75,30 @@ private IntBlock add(BooleanBlock block) {

@Override
public BooleanBlock[] getKeys() {
BooleanBlock.Builder builder = blockFactory.newBooleanBlockBuilder(everSeen.length);
if (everSeen[NULL_ORD]) {
builder.appendNull();
}
if (everSeen[FALSE_ORD]) {
builder.appendBoolean(false);
}
if (everSeen[TRUE_ORD]) {
builder.appendBoolean(true);
try (BooleanBlock.Builder builder = blockFactory.newBooleanBlockBuilder(everSeen.length)) {
if (everSeen[NULL_ORD]) {
builder.appendNull();
}
if (everSeen[FALSE_ORD]) {
builder.appendBoolean(false);
}
if (everSeen[TRUE_ORD]) {
builder.appendBoolean(true);
}
return new BooleanBlock[] { builder.build() };
}
return new BooleanBlock[] { builder.build() };
}

@Override
public IntVector nonEmpty() {
IntVector.Builder builder = blockFactory.newIntVectorBuilder(everSeen.length);
for (int i = 0; i < everSeen.length; i++) {
if (everSeen[i]) {
builder.appendInt(i);
try (IntVector.Builder builder = blockFactory.newIntVectorBuilder(everSeen.length)) {
for (int i = 0; i < everSeen.length; i++) {
if (everSeen[i]) {
builder.appendInt(i);
}
}
return builder.build();
}
return builder.build();
}

public BitArray seenGroupIds(BigArrays bigArrays) {
Expand Down

0 comments on commit 234521b

Please sign in to comment.