Performance: eliminate redundant function call
@@ -27,15 +27,15 @@ grib_handle* grib_handle_of_accessor(grib_accessor* a)
static grib_handle* handle_of(grib_accessor* observed)
{
grib_handle *h=NULL;
+ DebugAssert(observed);
/* printf("+++++ %s->parent = %p\n",observed->name,observed->parent); */
/* printf("+++++ %s = %p\n",observed->name,observed); */
/* printf("+++++ h=%p\n",observed->h); */
/* special case for BUFR attributes parentless */
- Assert(observed);
if (observed->parent==NULL) {
return observed->h;
}
- h = grib_handle_of_accessor(observed);
+ h = observed->parent->h;
while(h->main) h = h->main;
return h;
}
