Re: [Evolution-hackers] [evolution-patches] Avoiding a strdup in camel-folder-summar.c
- From: Chris Toshok <toshok ximian com>
- To: Philip Van Hoof <spam pvanhoof be>
- Cc: Evolution Patches <evolution-patches gnome org>, evolution-hackers gnome org
- Subject: Re: [Evolution-hackers] [evolution-patches] Avoiding a strdup in camel-folder-summar.c
- Date: Tue, 11 Jul 2006 09:28:41 -0400
No opinion on the rest of the patch, but this:
> +static void
> +free_token (gchar *token)
> +{
> + gint i=0;
> + gboolean no=FALSE;
> +
> + for (i=0; (i < tokens_len); i++)
> + {
> + if (tokens[i] == token)
> + no = TRUE;
> + }
> +
> + if (!no)
> + g_free (token);
> +}
> +
is more efficient as:
static void
free_token (gchar *token)
{
gint i;
for (i = 0; i < tokens_len; i ++)
if (tokens[i] == token)
return;
g_free (token);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]