Re:Fixing a memory leak of xmlEntityPtr in librsvg
by wizardforhire on Monday June 24, 2024 @02:00AM
(#40772961)
I really want to upvote you but you're at 13377 karma and I would hate to fuck that up!
Re:Fixing a memory leak of xmlEntityPtr in librsvg
by Panzer04 on Monday June 24, 2024 @03:25AM
(#40773327)
Handling it with early return in this way still seems odd. I guess if everything is built to be done with automatic handling via scope, I can see why this way is OK. The way this would be done in my experience is just checking a return code, which feels like it's a bit more explicit if you want to early-return.
Still, lots of incorrect code has been written with that pattern as well due to incomplete cleanup, so it's not really fair to blame this syntax for it XD.
(I think most mechanisms that can jump far, including returns, need to be used carefully - nesting a return deep into a bunch of loops is just as bad)
I can understand it not being intuitive to someone who has never seen it before, but that's purely a familiarity thing.