Re: [Nautilus-list] Icon directory contents caching



> +
> +static gboolean
> +icon_dir_cache_contains (IconDirCache *cache, char *name)
> +{
> +	char **file;
> +	
> +	file = cache->files;
> +
> +	while (*file != NULL) {
> +		if (strcmp (*file, name) == 0) {
> +			return TRUE;
> +		}
> +		file++;
> +	}
> +	
> +	return FALSE;
> +}
> +

I think it will be reasonably faster to use a hashtable here rather than
walking the whole list every time you want to find an icon in the cache.

But perhaps I'm missing something.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]