g_string_free



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]