Skip to content

Commit

Permalink
assemble
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Jul 22, 2024
1 parent 879ea8f commit 488a417
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import it.unimi.dsi.fastutil.ints.IntList;
import java.util.List;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import tech.pegasys.teku.infrastructure.ssz.collections.SszBitlist;
import tech.pegasys.teku.infrastructure.ssz.schema.SszContainerSchema;
Expand All @@ -38,7 +37,7 @@ public static IntList getVectorLengths(final SszContainerSchema<?> sszContainerS
}

public static SszBitlist not(final SszBitlist bitlist) {
List<Boolean> notList = bitlist.stream().map(b -> !b.get()).collect(Collectors.toList());
List<Boolean> notList = bitlist.stream().map(b -> !b.get()).toList();
int[] notBitIndices = IntStream.range(0, notList.size()).filter(notList::get).toArray();
return bitlist.getSchema().ofBits(bitlist.size(), notBitIndices);
}
Expand All @@ -55,8 +54,7 @@ private static void dumpBinaryTreeRec(
final String prefix,
final boolean printCommit,
final Consumer<String> linesConsumer) {
if (node instanceof LeafNode) {
LeafNode leafNode = (LeafNode) node;
if (node instanceof LeafNode leafNode) {
linesConsumer.accept(prefix + leafNode);
} else {
BranchNode branchNode = (BranchNode) node;
Expand Down

0 comments on commit 488a417

Please sign in to comment.