# HG changeset patch # User zas_ # Date 1209666390 0 # Node ID e62b2e06ab7ba178d7cd43a56187c0e44649b42c # Parent ea226ad80fc46d14d63db6bfcd8427437168eb11 Simplify and optimize extension_find_dot(). diff -r ea226ad80fc4 -r e62b2e06ab7b src/cache_maint.c --- a/src/cache_maint.c Tue Apr 29 22:44:06 2008 +0000 +++ b/src/cache_maint.c Thu May 01 18:26:30 2008 +0000 @@ -68,18 +68,17 @@ static gchar *extension_find_dot(gchar *path) { - gchar *ptr; + gchar *dot = NULL; - if (!path || *path == '\0') return NULL; + if (!path) return NULL; - ptr = path; - while (*ptr != '\0') ptr++; + while (*path != '\0') + { + if (*path == '.') dot = path; + path++; + } - while (ptr > path && *ptr != '.') ptr--; - - if (ptr == path) return NULL; - - return ptr; + return dot; } static gint isempty(const gchar *path)