Former-commit-id: 096ec1222ad723d006b0151f10cb0c1b95e2bfd3
This commit is contained in:
Jarred Sumner
2021-08-29 21:48:14 -07:00
parent 34792c15f1
commit bd9f137b1b
27 changed files with 2851 additions and 2263 deletions

View File

@@ -305,7 +305,7 @@ pub fn eqlComptime(self: string, comptime alt: anytype) bool {
second == std.mem.readIntNative(u16, self[4..6]);
},
5, 7 => {
const check = std.mem.readIntNative(u32, alt[0..4]);
const check = comptime std.mem.readIntNative(u32, alt[0..4]);
if (self.len != alt.len or std.mem.readIntNative(u32, self[0..4]) != check) {
return false;
}
@@ -316,7 +316,7 @@ pub fn eqlComptime(self: string, comptime alt: anytype) bool {
return true;
},
8 => {
const check = std.mem.readIntNative(u64, alt[0..alt.len]);
const check = comptime std.mem.readIntNative(u64, alt[0..alt.len]);
return self.len == alt.len and std.mem.readIntNative(u64, self[0..8]) == check;
},
9...11 => {
@@ -332,13 +332,13 @@ pub fn eqlComptime(self: string, comptime alt: anytype) bool {
return true;
},
12 => {
const first = std.mem.readIntNative(u64, alt[0..8]);
const second = std.mem.readIntNative(u32, alt[8..12]);
const first = comptime std.mem.readIntNative(u64, alt[0..8]);
const second = comptime std.mem.readIntNative(u32, alt[8..12]);
return (self.len == alt.len) and first == std.mem.readIntNative(u64, self[0..8]) and second == std.mem.readIntNative(u32, self[8..12]);
},
13...15 => {
const first = std.mem.readIntNative(u64, alt[0..8]);
const second = std.mem.readIntNative(u32, alt[8..12]);
const first = comptime std.mem.readIntNative(u64, alt[0..8]);
const second = comptime std.mem.readIntNative(u32, alt[8..12]);
if (self.len != alt.len or first != std.mem.readIntNative(u64, self[0..8]) or second != std.mem.readIntNative(u32, self[8..12])) {
return false;
@@ -351,8 +351,8 @@ pub fn eqlComptime(self: string, comptime alt: anytype) bool {
return true;
},
16 => {
const first = std.mem.readIntNative(u64, alt[0..8]);
const second = std.mem.readIntNative(u64, alt[8..15]);
const first = comptime std.mem.readIntNative(u64, alt[0..8]);
const second = comptime std.mem.readIntNative(u64, alt[8..15]);
return (self.len == alt.len) and first == std.mem.readIntNative(u64, self[0..8]) and second == std.mem.readIntNative(u64, self[8..16]);
},
else => {