3 ms·
I don’t see why this wouldn’t be performant: void transactionBoundary() { var list = someLongListOfElems; var resultList = List.of(); // a sum type f
by kaba0 4y ago
I don’t see why this wouldn’t be performant:
void transactionBoundary() {
var list = someLongListOfElems;
var resultList = List.of(); // a sum type for success and error conditions
for (var l : list) {
try {
resultList.add(process(l));
} catch (SpecificException e) {
// add to resulList or errorList or whatever to further process those instances.
// You can just use SpecificException’s fields
…
}
}
}