Re: macaddr 64 bit (EUI-64) datatype support - Mailing list pgsql-hackers

From Vitaly Burovoy
Subject Re: macaddr 64 bit (EUI-64) datatype support
Date
Msg-id CAKOSWNk87u3-qZX2yixts7wZ3ao_kwv+XB8+ePB5txFg82r3+A@mail.gmail.com
Whole thread Raw
In response to Re: macaddr 64 bit (EUI-64) datatype support  (Vitaly Burovoy <vitaly.burovoy@gmail.com>)
Responses Re: macaddr 64 bit (EUI-64) datatype support  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I'm sorry for the offtopic, but does anyone know a reason why a
condition in mac.c

> if ((a < 0) || (a > 255) || (b < 0) || (b > 255) ||
>     (c < 0) || (c > 255) || (d < 0) || (d > 255) ||
>     (e < 0) || (e > 255) || (f < 0) || (f > 255))

can not be rewritten as:

> if (((a | b | c | d | e | f) < 0) ||
>     ((a | b | c | d | e | f) > 255))

It seems more compact and a compiler can optimize it to keep a result
of a binary OR for the comparison with 255...

-- 
Best regards,
Vitaly Burovoy



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: munmap() failure due to sloppy handling of hugepage size
Next
From: Tom Lane
Date:
Subject: Re: macaddr 64 bit (EUI-64) datatype support