Re: [Evolution-hackers] Avoiding a strdup in camel-folder-summar.c
Chris Toshok <[email protected]>
| Newsgroups | gmane.comp.gnome.evolution.patches,gmane.comp.gnome.evolution.devel |
|---|---|
| Message-ID | <[email protected]> |
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);
}