[Python-checkins] r46132 - python/trunk/Objects/unicodeobject.c

A.M. Kuchling amk at amk.ca
Tue May 23 21:18:08 CEST 2006


On Tue, May 23, 2006 at 08:44:26PM +0200, fredrik.lundh wrote:
> +LOCAL(int) unicode_member(Py_UNICODE chr, Py_UNICODE* set, Py_ssize_t setlen)
> +{
> +    Py_ssize_t i;
> +
> +    for (i = 0; i < setlen; i++)
> +        if (set[i] == chr)
> +            return 1;
> +
> +    return -1;
> +}
> +
> +#define BLOOM_MEMBER(mask, chr, set, setlen)\
> +    BLOOM(mask, chr) && unicode_member(chr, set, setlen)

unicode_member returns 1 if found, -1 if not; doesn't this mean that
the second part of the && in BLOOM_MEMBER() will always be true?

--amk


More information about the Python-checkins mailing list