mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-11 16:51:53 +03:00
only conditionally flip a bit
This commit is contained in:
parent
49708cfff8
commit
106f1311d2
@ -66,11 +66,14 @@ fn capacityOfLevel(input: usize) usize {
|
||||
const Alignment = extern struct {
|
||||
bits: u8,
|
||||
|
||||
const VALUE_BEFORE_KEY_FLAG = 0b1000_0000;
|
||||
const VALUE_BEFORE_KEY_FLAG: u8 = 0b1000_0000;
|
||||
|
||||
fn toU32(self: Alignment) u32 {
|
||||
// xor to wipe the leftmost bit
|
||||
return self.bits ^ Alignment.VALUE_BEFORE_KEY_FLAG;
|
||||
if (self.bits & Alignment.VALUE_BEFORE_KEY_FLAG == 1) {
|
||||
return self.bits ^ Alignment.VALUE_BEFORE_KEY_FLAG;
|
||||
} else {
|
||||
return self.bits;
|
||||
}
|
||||
}
|
||||
|
||||
fn keyFirst(self: Alignment) bool {
|
||||
|
Loading…
Reference in New Issue
Block a user