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 669313 - .data for StringBuilder
.data for StringBuilder
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings: GLib
unspecified
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2012-02-03 15:29 UTC by Allison Karlitskaya (desrt)
Modified: 2012-02-05 00:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glib: add .data to StringBuilder (896 bytes, patch)
2012-02-03 15:53 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2012-02-03 15:29:13 UTC
'StringBuilder' should have a .data field just like 'string'.

'builder.str.data' works, but it does an extra strlen() and produces incorrect results if the GString contains nuls.  We have the .len field, so we could do a better job of this.
Comment 1 Allison Karlitskaya (desrt) 2012-02-03 15:53:34 UTC
Created attachment 206686 [details] [review]
glib: add .data to StringBuilder

To do the same thing as string.data, but without the strlen() (since we
already know this from the GString's length field).
Comment 2 Evan Nemerson 2012-02-04 22:40:32 UTC
Review of attachment 206686 [details] [review]:

Good idea.
Comment 3 Allison Karlitskaya (desrt) 2012-02-05 00:35:30 UTC
Attachment 206686 [details] pushed as cd1dc09 - glib: add .data to StringBuilder