mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
Fix a dumb (thanks daurminator!)
This commit is contained in:
parent
13ea698a40
commit
638554544a
@ -35,13 +35,7 @@ pub const Register = enum(u8) {
|
||||
}
|
||||
|
||||
pub fn id(self: @This()) u4 {
|
||||
return @intCast(u4, switch (@enumToInt(self)) {
|
||||
0...15 => |i| i,
|
||||
16...31 => |i| i - 16,
|
||||
32...47 => |i| i - 32,
|
||||
48...64 => |i| i - 48,
|
||||
else => unreachable,
|
||||
});
|
||||
return @truncate(u4, @enumToInt(self));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user