Closed bakkot closed 2 years ago
mapWithIndex is great, but sometimes you need the index during other operations. Currently you have to do .mapWithIndex(Pair::of).filter(pair -> ...).map(Pair::right), which is painful (and a lot of allocations).
mapWithIndex
.mapWithIndex(Pair::of).filter(pair -> ...).map(Pair::right)
mapWithIndex
is great, but sometimes you need the index during other operations. Currently you have to do.mapWithIndex(Pair::of).filter(pair -> ...).map(Pair::right)
, which is painful (and a lot of allocations).