Mercurial > pidgin.yaz
diff src/accountopt.c @ 14035:8bda65b88e49
[gaim-migrate @ 16638]
A bunch of small changes. Mostly remove "if not null" checks before
calling g_free, g_list_free, g_slist_free and g_strdup. Also use
g_list_foreach() to call g_free to free strings in an array. And
some whitespace changes here and there.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 05 Aug 2006 08:27:39 +0000 |
parents | f09c6e8df82c |
children |
line wrap: on
line diff
--- a/src/accountopt.c Sat Aug 05 05:42:28 2006 +0000 +++ b/src/accountopt.c Sat Aug 05 08:27:39 2006 +0000 @@ -87,8 +87,7 @@ if (option == NULL) return NULL; - if (default_value != NULL) - option->default_value.string = g_strdup(default_value); + option->default_value.string = g_strdup(default_value); return option; } @@ -159,10 +158,8 @@ g_return_if_fail(option != NULL); g_return_if_fail(option->type == GAIM_PREF_STRING); - if (option->default_value.string != NULL) - g_free(option->default_value.string); - - option->default_value.string = (value == NULL ? NULL : g_strdup(value)); + g_free(option->default_value.string); + option->default_value.string = g_strdup(value); } void @@ -310,8 +307,7 @@ split->text = g_strdup(text); split->field_sep = sep; - split->default_value = (default_value == NULL - ? NULL : g_strdup(default_value)); + split->default_value = g_strdup(default_value); return split; } @@ -321,12 +317,8 @@ { g_return_if_fail(split != NULL); - if (split->text != NULL) - g_free(split->text); - - if (split->default_value != NULL) - g_free(split->default_value); - + g_free(split->text); + g_free(split->default_value); g_free(split); }