3 ms·
> So, you get the best of both worlds. I would really not call code that looks like this "best of both worlds" KJ_IF_MAYBE(value, maybeValue) { use(
by jcelerier 6y ago
> So, you get the best of both worlds.
I would really not call code that looks like this "best of both worlds"
KJ_IF_MAYBE(value, maybeValue) {
use(value);
} else {
handleNull();
}
when compared to
if(!value)
handleNull();
use(*value);
- kentonv 6y agoKind of unfair that you didn't include the `else` or the braces in your version, just to make it look shorter.