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 699533 - giscanner: some small cleanup patches
giscanner: some small cleanup patches
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-05-02 22:01 UTC by Dieter Verfaillie
Modified: 2015-02-07 16:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
giscanner: Define source and header filename extensions only once (2.64 KB, patch)
2013-05-02 22:01 UTC, Dieter Verfaillie
accepted-commit_now Details | Review
giscanner: small cpp_args cleanup (1.80 KB, patch)
2013-05-02 22:01 UTC, Dieter Verfaillie
accepted-commit_now Details | Review
giscanner: simplify the MainTransformer().transform() method (1.52 KB, patch)
2013-05-02 22:01 UTC, Dieter Verfaillie
accepted-commit_now Details | Review
giscanner: remove unneeded encode('utf-8').decode('utf-8') roundtrip (1.13 KB, patch)
2013-05-02 22:01 UTC, Dieter Verfaillie
accepted-commit_now Details | Review

Description Dieter Verfaillie 2013-05-02 22:01:14 UTC
broken out of some larger work as individual commits for easy review
Comment 1 Dieter Verfaillie 2013-05-02 22:01:19 UTC
Created attachment 243113 [details] [review]
giscanner: Define source and header filename extensions only once

Enables us to to use a more effecient list membership test
instead of testing the end of some string multiple times.
Comment 2 Dieter Verfaillie 2013-05-02 22:01:24 UTC
Created attachment 243114 [details] [review]
giscanner: small cpp_args cleanup

No need for two variables...
Comment 3 Dieter Verfaillie 2013-05-02 22:01:28 UTC
Created attachment 243115 [details] [review]
giscanner: simplify the MainTransformer().transform() method

The ast.Namespace.names instance attribute is an OrderedDict
which itself is a specialised dict() subclass. There are any
number of ways to test if a dict() is empty or not. Creating
a copy of it's keys by iterating over them just to count the
number of items in the copy is not the most elegant way though.
Comment 4 Dieter Verfaillie 2013-05-02 22:01:33 UTC
Created attachment 243116 [details] [review]
giscanner: remove unneeded encode('utf-8').decode('utf-8') roundtrip

line is a unicode() instance, xml.sax.saxutils.escape() does
nothing more than call a couple of replace() methods on said
unicode() instance so it makes little sense to encode line
into a str() and decode the escaped result back into a unicode().
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-05-04 00:57:08 UTC
Review of attachment 243113 [details] [review]:

OK.
Comment 6 Colin Walters 2013-05-07 00:01:35 UTC
Review of attachment 243114 [details] [review]:

This looks fine, but it will need to be rebased.
Comment 7 Colin Walters 2013-05-07 00:02:46 UTC
Review of attachment 243115 [details] [review]:

Ok.
Comment 8 Colin Walters 2013-05-07 00:03:30 UTC
Review of attachment 243116 [details] [review]:

Right.
Comment 10 André Klapper 2015-02-07 16:46:24 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]