# HG changeset patch # User zas_ # Date 1219524391 0 # Node ID 8cef771ff0fb3a591cebe1653bb430884bc22629 # Parent bc73dc055cd02d7867a739be8e2dd927f5ae70a6 Minor optimization: no need to copy the whole remaining of the string, just copy next char. diff -r bc73dc055cd0 -r 8cef771ff0fb 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);