Re:Antirez' tiny JSON selector library
by pjscott on Tuesday November 28, 2023 @01:06AM
(#38442881)
It's the normal use of goto in C: you run into some exceptional circumstance, you don't know how to deal with it, so you goto some code that cleans up any unfinished business you might have, like memory allocations – and then you return some error code as soon as you can, once everything is in a good state.
[ Parent
| on HN ]
Interestingly, he also uses it for the happy path, instead of using `break`. I wonder why.