g_string_free
- From: Michael Meeks <michael helixcode com>
- To: gtk-devel-list redhat com
- Subject: g_string_free
- Date: Fri, 28 Jul 2000 20:14:28 -0400 (EDT)
I was just using g_string_free for the umpteenth time, and I
wondered; would it be possible to return the ->str member from
the free method ( if free_segment == FALSE ) ?
Then I can remove lines and tedium from my code having:
GString *str = g_string_new ("foo");
g_string_append (str, "baa");
return g_string_free (str, FALSE);
Instead of:
GString *str = g_string_new ("foo");
char *p;
g_string_append (str, "baa");
p = str->_str;
g_string_free (str, FALSE);
return p;
Which I'm sure you'll agree is rather longer and
more tedious. I'm certain the overhead will be
negligable. If it sounds good, but due to
maintainer overload it is not possible to do, I
could make a patch up if you desire :-)
Regards,
Michael.
--
mmeeks@gnu.org <><, Pseudo Engineer, itinerant idiot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]