Revision: 1080
          http://geeqie.svn.sourceforge.net/geeqie/?rev=1080&view=rev
Author:   zas_
Date:     2008-08-23 20:46:31 +0000 (Sat, 23 Aug 2008)

Log Message:
-----------
Minor optimization: no need to copy the whole remaining of the string, just 
copy next char.

Modified Paths:
--------------
    trunk/src/exif-common.c

Modified: trunk/src/exif-common.c
===================================================================
--- trunk/src/exif-common.c     2008-08-23 17:35:57 UTC (rev 1079)
+++ trunk/src/exif-common.c     2008-08-23 20:46:31 UTC (rev 1080)
@@ -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);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn

Reply via email to