From 3203754b52f9df84b477b840eb4051c7a52746d9 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 18 Dec 2002 02:38:34 +0000 Subject: [PATCH] minor optimization in the unreference routine --- src/gdd/gddI.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gdd/gddI.h b/src/gdd/gddI.h index 20be72d5b..b0f9ec777 100644 --- a/src/gdd/gddI.h +++ b/src/gdd/gddI.h @@ -162,13 +162,8 @@ inline gddStatus gdd::unreference(void) const if ( ref_cnt > 1u ) { ref_cnt--; } - else if ( ref_cnt == 0u ) + else if ( ref_cnt == 1u ) { - fprintf(stderr,"gdd reference count underflow!!\n"); - gddAutoPrint("gdd::unreference()",gddErrorUnderflow); - rc=gddErrorUnderflow; - } - else { if ( isManaged() ) { // managed dd always destroys the entire thing if(destruct) destruct->destroy((void *)this); @@ -181,6 +176,11 @@ inline gddStatus gdd::unreference(void) const delete this; } } + else { + fprintf(stderr,"gdd reference count underflow!!\n"); + gddAutoPrint("gdd::unreference()",gddErrorUnderflow); + rc=gddErrorUnderflow; + } return rc; }