Performance: reduce number of calls to init
@@ -47,11 +47,15 @@ static void init_mutex()
static void init(grib_action_class *c)
{
+ if (!c) return;
+
GRIB_MUTEX_INIT_ONCE(&once,&init_mutex);
GRIB_MUTEX_LOCK(&mutex1);
- if(c && !c->inited)
+ if(!c->inited)
{
- init(c->super ? *(c->super) : NULL);
+ if (c->super) {
+ init( *(c->super) );
+ }
c->init_class(c);
c->inited = 1;
}
