recursion check in 'taste' functions ?

Luigi Rizzo rizzo at iet.unipi.it
Thu Jan 15 00:05:15 PST 2009


Hi,
I notice that the check to prevent recursion in the 'taste'
function is always based on a string comparison, written
in various forms, e.g.,

	if (strcmp(pp->geom->class->name, mp->name) == 0)
                return (NULL);
	...
	if (!strcmp(pp->geom->class->name, MBR_CLASS_NAME))
                return (NULL);

Wouldn't the following be more efficient (and perhaps correct) ?

	if (pp->geom->class == mp)
		return (NULL);


This is because pp->geom->class is always initialized with a pointer
to the class descriptor, and I guess it cannot be different...

	cheers
	luigi


More information about the freebsd-geom mailing list