minor optimization in the unreference routine

This commit is contained in:
Jeff Hill
2002-12-18 02:38:34 +00:00
parent a22835e835
commit 3203754b52
+6 -6
View File
@@ -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;
}