From d753e0d26ee9f09d84cb295af9f56e38e6cff2b6 Mon Sep 17 00:00:00 2001 From: Cristy Date: Tue, 17 Apr 2018 20:26:04 -0400 Subject: [PATCH] ... --- MagickCore/list.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/MagickCore/list.c b/MagickCore/list.c index c6e62c3f0..2646d6b7c 100644 --- a/MagickCore/list.c +++ b/MagickCore/list.c @@ -599,17 +599,10 @@ MagickExport Image *GetImageFromList(const Image *images,const ssize_t index) assert(images->signature == MagickCoreSignature); if (images->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename); - - /* - Designed to efficiently find first image (index == 0), or last image - (index == -1) as appropriate, without to go through the whole image list. - That is it tries to avoid 'counting the whole list' to handle the - most common image indexes. - */ - if ( index < 0 ) + if (index < 0) { p=GetLastImageInList(images); - for (i=-1; p != (Image *) NULL; p=p->previous) + for (i=(-1); p != (Image *) NULL; p=p->previous) if (i-- == index) break; } -- 2.40.0