After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 697622 - giscanner: make _pass_read_annotations2() more readable
giscanner: make _pass_read_annotations2() more readable
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-04-09 09:20 UTC by Dieter Verfaillie
Modified: 2015-02-07 16:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
giscanner: make _pass_read_annotations2() more readable (3.25 KB, patch)
2013-04-09 09:21 UTC, Dieter Verfaillie
none Details | Review
giscanner: make _pass_read_annotations2() more readable (3.24 KB, patch)
2013-04-09 10:00 UTC, Dieter Verfaillie
accepted-commit_now Details | Review

Description Dieter Verfaillie 2013-04-09 09:20:16 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'...
Comment 1 Dieter Verfaillie 2013-04-09 09:21:28 UTC
Created attachment 241038 [details] [review]
giscanner: make _pass_read_annotations2() more readable
Comment 2 Dieter Verfaillie 2013-04-09 10:00:16 UTC
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...
Comment 3 Colin Walters 2013-04-09 14:05:11 UTC
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?
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-04-09 21:04:40 UTC
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.
Comment 5 Dieter Verfaillie 2013-04-09 21:06:06 UTC
(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 :)
Comment 6 Dieter Verfaillie 2013-05-06 13:59:35 UTC
Any decision on this?
Comment 7 Colin Walters 2013-05-07 00:05:13 UTC
(In reply to comment #6)
> Any decision on this?

If you think it's better, that's fine by me; please commit.
Comment 9 André Klapper 2015-02-07 16:53:36 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]