New function that now holds the main logic of the old camel_pstring_strdup
authorJeffrey Stedfast <fejj@novell.com>
Thu, 6 Jul 2006 19:43:47 +0000 (19:43 +0000)
committerJeffrey Stedfast <fejj@src.gnome.org>
Thu, 6 Jul 2006 19:43:47 +0000 (19:43 +0000)
commitcd6be28822900337ef6dd3d527b309f55f359cd7
treedebffcca101fd4eff64f2dc33c5a4b20a18eb786
parentad9dac2a49fb9bcadaa1e995b3cab4b414b243ed
New function that now holds the main logic of the old camel_pstring_strdup

2006-07-06  Jeffrey Stedfast  <fejj@novell.com>

* camel-string-utils.c (camel_pstring_add): New function that now
holds the main logic of the old camel_pstring_strdup function. If
'own' is TRUE, re-use the memory if the string doesn't already
exist and free it otherwise. If FALSE, strdup the value if it
doesn't already exist.
(camel_pstring_strdup): Calls camel_pstring_add() with 'own' as
FALSE.

* camel-folder-summary.c (message_info_new_from_header): Use
camel_pstring_add instead of camel_pstring_strdup here to prevent
unnecessary strdup/freeing.
(message_info_load): Same.
camel/ChangeLog
camel/camel-folder-summary.c
camel/camel-string-utils.c
camel/camel-string-utils.h