From: dirk Date: Sun, 27 Apr 2014 16:42:54 +0000 (+0000) Subject: Minor refactoring. X-Git-Tag: 7.0.1-0~2403 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3efeece86a747d7cd4bc18ddb09791a2f5aee0ad;p=imagemagick Minor refactoring. --- diff --git a/MagickCore/exception.c b/MagickCore/exception.c index b3a5e1e97..f6d9e57e6 100644 --- a/MagickCore/exception.c +++ b/MagickCore/exception.c @@ -152,22 +152,13 @@ static void *DestroyExceptionElement(void *exception) MagickExport void ClearMagickException(ExceptionInfo *exception) { - register ExceptionInfo - *p; - assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); - if (exception->exceptions == (void *) NULL) + if (exception->exceptions == (void *) NULL) return; LockSemaphoreInfo(exception->semaphore); - p=(ExceptionInfo *) RemoveLastElementFromLinkedList((LinkedListInfo *) - exception->exceptions); - while (p != (ExceptionInfo *) NULL) - { - (void) DestroyExceptionElement(p); - p=(ExceptionInfo *) RemoveLastElementFromLinkedList((LinkedListInfo *) - exception->exceptions); - } + ClearLinkedList((LinkedListInfo *) exception->exceptions, + DestroyExceptionElement); exception->severity=UndefinedException; exception->reason=(char *) NULL; exception->description=(char *) NULL;