forked from TrueCloudLab/frostfs-sdk-go
[#47] acl: Remove unused resetBit()
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
708d933fe3
commit
1395b282fe
2 changed files with 0 additions and 13 deletions
|
@ -7,16 +7,6 @@ func setBit(num *uint32, n uint8) {
|
||||||
*num |= 1 << n
|
*num |= 1 << n
|
||||||
}
|
}
|
||||||
|
|
||||||
// resets n-th bit in num (starting at 0).
|
|
||||||
//
|
|
||||||
// nolint: unused
|
|
||||||
func resetBit(num *uint32, n uint8) {
|
|
||||||
var mask uint32
|
|
||||||
setBit(&mask, n)
|
|
||||||
|
|
||||||
*num &= ^mask
|
|
||||||
}
|
|
||||||
|
|
||||||
// checks if n-th bit in num is set (starting at 0).
|
// checks if n-th bit in num is set (starting at 0).
|
||||||
func isBitSet(num uint32, n uint8) bool {
|
func isBitSet(num uint32, n uint8) bool {
|
||||||
mask := uint32(1 << n)
|
mask := uint32(1 << n)
|
||||||
|
|
|
@ -22,9 +22,6 @@ func TestBits(t *testing.T) {
|
||||||
|
|
||||||
setBit(&num, 6)
|
setBit(&num, 6)
|
||||||
require.EqualValues(t, 0b1011110, num)
|
require.EqualValues(t, 0b1011110, num)
|
||||||
|
|
||||||
resetBit(&num, 1)
|
|
||||||
require.EqualValues(t, 0b1011100, num)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestOpBits(t *testing.T) {
|
func TestOpBits(t *testing.T) {
|
||||||
|
|
Loading…
Reference in a new issue