Skip to content

Commit

Permalink
use startsWith instead of eql
Browse files Browse the repository at this point in the history
  • Loading branch information
ATTron committed Jul 17, 2024
1 parent 27c43df commit 798ee01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parsers.zig
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub fn Parser(comptime Frame: type) type {
if (sync_pattern) |sp| {
var i: usize = 0;
while (file_content.len > 4) : (i += 1) {
if (std.mem.eql(u8, file_content[i .. i + sp.len], sp)) {
if (std.mem.startsWith(u8, file_content[i..], sp)) {
const new_frame = try Frame.init(file_content[i..], self.allocator, null);
try self.packets.append(new_frame);
if (callback) |cb| {
Expand Down Expand Up @@ -101,7 +101,7 @@ pub fn Parser(comptime Frame: type) type {
if (sync_pattern) |sp| {
var i: usize = 0;
while (file_content.len > 4) : (i += 1) {
if (std.mem.eql(u8, file_content[i .. i + sp.len], sp)) {
if (std.mem.startsWith(u8, file_content[i..], sp)) {
const new_frame = try Frame.init(file_content[i..], self.allocator, null);
try self.packets.append(new_frame);
if (callback) |cb| {
Expand Down

0 comments on commit 798ee01

Please sign in to comment.