GNOME Bugzilla – Bug 697622
giscanner: make _pass_read_annotations2() more readable
Last modified: 2015-02-07 16:53:36 UTC
_apply_annotations2_function() is only ever called by _pass_read_annotations2() so there's no need to go and hide what's being done behind an extra method call. Also change the 'if not something; return' into a more readable 'if something: do something'...
Created attachment 241038 [details] [review] giscanner: make _pass_read_annotations2() more readable
Created attachment 241045 [details] [review] giscanner: make _pass_read_annotations2() more readable Turns out the previous version of this patch needed stuff still on my branch. Fixed that. Ah, the perils of interactive git rebase...
Review of attachment 241045 [details] [review]: Hmm. This is a harder case. Honestly I often tend to write Python using some of the same ways I write C. Specifically early exit is often far better in C because it's easier to do memory management. Granted, that doesn't apply to Python. Jasper, as another person who actively hacks the Python, do you have an opinion on one way or the other?
Review of attachment 241045 [details] [review]: I'm not 100% sure on this, but leaning more towards liking it because I like the cleanup here: https://github.com/dieterv/gobject-introspection/commit/59d7bfc7b4ac41abed303316c5301f8a23a02967 And this is a similar cleanup.
(In reply to comment #4) > I'm not 100% sure on this, but leaning more towards liking it because I like > the cleanup here: > > https://github.com/dieterv/gobject-introspection/commit/59d7bfc7b4ac41abed303316c5301f8a23a02967 That's https://bugzilla.gnome.org/show_bug.cgi?id=697621 :)
Any decision on this?
(In reply to comment #6) > Any decision on this? If you think it's better, that's fine by me; please commit.
https://git.gnome.org/browse/gobject-introspection/commit/?id=beadfeff33302a3012fb5df1a7197cb4fac8f6f6
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]