1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00
* make a local variable for target_table->field[col]
* move an often-used bit function to my_bit.h
* remove a non-static and not really needed trivial comparison
  function with a very generic name
This commit is contained in:
Sergei Golubchik
2016-02-19 12:06:37 +01:00
parent ab2a9600a7
commit d4b1425b60
4 changed files with 26 additions and 42 deletions

View File

@@ -121,6 +121,15 @@ static inline uint32 my_reverse_bits(uint32 key)
_my_bits_reverse_table[(key>>24) ];
}
/*
a number with the n lowest bits set
an overflow-safe version of (1 << n) - 1
*/
static inline uint32 my_set_bits(int n)
{
return (((1UL << (n - 1)) - 1) << 1) | 1;
}
C_MODE_END
#endif /* MY_BIT_INCLUDED */