]> granicus.if.org Git - imagemagick/commitdiff
Fixed duplicate compare.
authordirk <dirk@git.imagemagick.org>
Tue, 16 Dec 2014 19:56:13 +0000 (19:56 +0000)
committerdirk <dirk@git.imagemagick.org>
Tue, 16 Dec 2014 19:56:13 +0000 (19:56 +0000)
MagickCore/color.c
MagickCore/delegate.c

index 1bf2d48135a1cd67a3fd00ae60207fafa0f984d7..8e46550e399d023d20848800c36097f3a81c9059 100644 (file)
@@ -1254,11 +1254,15 @@ static int ColorInfoCompare(const void *x,const void *y)
     **p,
     **q;
 
+  int
+    cmp;
+
   p=(const ColorInfo **) x,
   q=(const ColorInfo **) y;
-  if (LocaleCompare((*p)->path,(*q)->path) == 0)
+  cmp=LocaleCompare((*p)->path,(*q)->path);
+  if (cmp == 0)
     return(LocaleCompare((*p)->name,(*q)->name));
-  return(LocaleCompare((*p)->path,(*q)->path));
+  return(cmp);
 }
 
 #if defined(__cplusplus) || defined(c_plusplus)
index bb040277572fe98afa72b8c4b171122fb79f86e2..14ee2562cc3c84dbe9a49bc76de84ac9d86d6205 100644 (file)
@@ -708,9 +708,13 @@ static int DelegateInfoCompare(const void *x,const void *y)
     **p,
     **q;
 
+  int
+    cmp;
+
   p=(const DelegateInfo **) x,
   q=(const DelegateInfo **) y;
-  if (LocaleCompare((*p)->path,(*q)->path) == 0)
+  cmp=LocaleCompare((*p)->path,(*q)->path);
+  if (cmp == 0)
     {
       if ((*p)->decode == (char *) NULL)
         if (((*p)->encode != (char *) NULL) &&
@@ -720,7 +724,7 @@ static int DelegateInfoCompare(const void *x,const void *y)
           ((*q)->decode != (char *) NULL))
         return(strcmp((*p)->decode,(*q)->decode));
     }
-  return(LocaleCompare((*p)->path,(*q)->path));
+  return(cmp);
 }
 
 #if defined(__cplusplus) || defined(c_plusplus)