]> granicus.if.org Git - imagemagick/commitdiff
Use the new GetRootValueFromSplayTree.
authorDirk Lemstra <dirk@git.imagemagick.org>
Sun, 17 Sep 2017 04:32:01 +0000 (06:32 +0200)
committerDirk Lemstra <dirk@git.imagemagick.org>
Sun, 17 Sep 2017 04:32:01 +0000 (06:32 +0200)
MagickCore/artifact.c
MagickCore/property.c

index b98c3601c98194e09e47f5c1793c88947af473ee..0dab41e5b01c4f9ae7f6a648929ee82f03570ffe 100644 (file)
@@ -281,15 +281,11 @@ MagickExport const char *GetImageArtifact(const Image *image,
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   p=(const char *) NULL;
-  if (artifact == (const char *) NULL)
-    {
-      ResetSplayTreeIterator((SplayTreeInfo *) image->artifacts);
-      p=(const char *) GetNextValueInSplayTree((SplayTreeInfo *)
-        image->artifacts);
-      return(p);
-    }
   if (image->artifacts != (void *) NULL)
     {
+      if (artifact == (const char *) NULL)
+        return((const char *) GetRootValueFromSplayTree((SplayTreeInfo *)
+          image->artifacts));
       p=(const char *) GetValueFromSplayTree((SplayTreeInfo *) image->artifacts,
         artifact);
       if (p != (const char *) NULL)
index 9dc09ebe11f8f67ab3f4282dd94344d72d194913..02da55579b9e0a7df33e044c341dfab76ed02f91 100644 (file)
@@ -2196,16 +2196,12 @@ MagickExport const char *GetImageProperty(const Image *image,
   if (image->properties != (void *) NULL)
     {
       if (property == (const char *) NULL)
-        {
-          ResetSplayTreeIterator((SplayTreeInfo *) image->properties);
-          p=(const char *) GetNextValueInSplayTree((SplayTreeInfo *)
-            image->properties);
-          return(p);
-        }
-        p=(const char *) GetValueFromSplayTree((SplayTreeInfo *)
+        return((const char *) GetRootValueFromSplayTree((SplayTreeInfo *)
+          image->properties));
+      p=(const char *) GetValueFromSplayTree((SplayTreeInfo *)
           image->properties,property);
-        if (p != (const char *) NULL)
-          return(p);
+      if (p != (const char *) NULL)
+        return(p);
     }
   if ((property == (const char *) NULL) ||
       (strchr(property,':') == (char *) NULL))