math.big: remove unnecessary casting from Integer.is_power_of_2/0 (#24614)

This commit is contained in:
Mike 2025-05-30 14:15:39 +03:00 committed by GitHub
parent 5e2ce5f3e1
commit 0d00eb712c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1224,7 +1224,7 @@ pub fn (x Integer) is_power_of_2() bool {
return false return false
} }
} }
n := u32(x.digits.last()) n := x.digits.last()
return n & (n - u32(1)) == 0 return n & (n - u32(1)) == 0
} }