# HG changeset patch # User Laurent Monin # Date 1219524391 0 # Node ID f35ec0ea2eddb52b949818debf29d0fa3ccb559b # Parent 3d834c6040ab6e7e70df2a6194b4aa55aae8e1b8 Minor optimization: no need to copy the whole remaining of the string, just copy next char. diff -r 3d834c6040ab -r f35ec0ea2edd src/exif-common.c --- a/src/exif-common.c Sat Aug 23 17:35:57 2008 +0000 +++ b/src/exif-common.c Sat Aug 23 20:46:31 2008 +0000 @@ -154,19 +154,18 @@ if (software) { - gint i; + gint i, j; g_strstrip(software); /* remove superfluous spaces (pentax K100D) */ - for (i = 0; software[i]; i++) + for (i = 0, j = 0; software[i]; i++, j++) + { if (software[i] == ' ' && software[i + 1] == ' ') - { - gint j; - - for (j = 1; software[i + j] == ' '; j++); - memmove(software + i + 1, software + i + j, strlen(software + i + j) + 1); - } + i++; + if (i != j) software[j] = software[i]; + } + software[j] = '\0'; } model2 = remove_common_prefix(make, model);