mirror of
https://github.com/postgres/postgres.git
synced 2025-07-18 17:42:25 +03:00
Use bitwise rotate functions in more places
There were a number of places in the code that used bespoke bit-twiddling expressions to do bitwise rotation. While we've had pg_rotate_right32() for a while now, we hadn't gotten around to standardizing on that. Do so now. Since many potential call sites look more natural with the "left" equivalent, add that function too. Reviewed by Tom Lane and Yugo Nagata Discussion: https://www.postgresql.org/message-id/CAFBsxsH7c1LC0CGZ0ADCBXLHU5-%3DKNXx-r7tHYPAW51b2HK4Qw%40mail.gmail.com
This commit is contained in:
@ -1840,8 +1840,8 @@ ExecHashGetHashValue(HashJoinTable hashtable,
|
||||
Datum keyval;
|
||||
bool isNull;
|
||||
|
||||
/* rotate hashkey left 1 bit at each step */
|
||||
hashkey = (hashkey << 1) | ((hashkey & 0x80000000) ? 1 : 0);
|
||||
/* combine successive hashkeys by rotating */
|
||||
hashkey = pg_rotate_left32(hashkey, 1);
|
||||
|
||||
/*
|
||||
* Get the join attribute value of the tuple
|
||||
|
Reference in New Issue
Block a user