News for hackers. Stuff that matters.
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.
Re:Antirez' tiny JSON selector library by pcl on Tuesday November 28, 2023 @03:10AM (#38443515)
Interestingly, he also uses it for the happy path, instead of using `break`. I wonder why.
Re:Antirez' tiny JSON selector library by gpvos on Tuesday November 28, 2023 @05:48AM (#38444463)
Inside the loop I only see him gotoing to the `notfound` label, which I would say is the sad path.