Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jan 2009 09:10:25 +0100
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        geom@freebsd.org, Luigi Rizzo <rizzo@iet.unipi.it>
Subject:   recursion check in 'taste' functions ?
Message-ID:  <20090115081025.GA76218@onelab2.iet.unipi.it>
In-Reply-To: <20090113122111.GA89189@onelab2.iet.unipi.it>
References:  <20090113122111.GA89189@onelab2.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090115081025.GA76218>