Skip to content

Commit

Permalink
doesn't need to be pub
Browse files Browse the repository at this point in the history
  • Loading branch information
scheibo committed Jul 18, 2023
1 parent faa0171 commit f948dc1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/tools/copies.zig
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ pub fn main() !void {
}
}

fn cut(haystack: []const u8, needle: []const u8) ?struct { []const u8, []const u8 } {
const index = std.mem.indexOf(u8, haystack, needle) orelse return null;
return .{ haystack[0..index], haystack[index + needle.len ..] };
}

fn extractFuncName(define: []const u8, buf: []u8) ?[]const u8 {
const func_name = (cut(define, "@") orelse return null)[1];
var buf_count: usize = 0;
Expand Down Expand Up @@ -124,8 +129,3 @@ test "extractMemcpySize" {
\\ call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %8, i8* align 1 %4, i64 %6, i1 false)
, 0);
}

pub fn cut(haystack: []const u8, needle: []const u8) ?struct { []const u8, []const u8 } {
const index = std.mem.indexOf(u8, haystack, needle) orelse return null;
return .{ haystack[0..index], haystack[index + needle.len ..] };
}

0 comments on commit f948dc1

Please sign in to comment.