aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/Step/CheckObject.zig
diff options
context:
space:
mode:
authorRyan Liptak <squeek502@hotmail.com>2023-05-04 18:05:40 -0700
committerRyan Liptak <squeek502@hotmail.com>2023-05-13 13:45:04 -0700
commit815e53b147a321d0bdb47dc008aa8181f57175ac (patch)
treedc4b4107c3fa8a50032d6d916a57a1718a445fc9 /lib/std/Build/Step/CheckObject.zig
parentce9f3ec990cd556f2a9d06a6db2bb53e97a61172 (diff)
downloadzig-815e53b147a321d0bdb47dc008aa8181f57175ac.tar.gz
zig-815e53b147a321d0bdb47dc008aa8181f57175ac.zip
Update all std.mem.tokenize calls to their appropriate function
Everywhere that can now use `tokenizeScalar` should get a nice little performance boost.
Diffstat (limited to 'lib/std/Build/Step/CheckObject.zig')
-rw-r--r--lib/std/Build/Step/CheckObject.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/Build/Step/CheckObject.zig b/lib/std/Build/Step/CheckObject.zig
index c77dc3de36..24ebfef388 100644
--- a/lib/std/Build/Step/CheckObject.zig
+++ b/lib/std/Build/Step/CheckObject.zig
@@ -103,8 +103,8 @@ const Action = struct {
assert(act.tag == .match or act.tag == .not_present);
const phrase = act.phrase.resolve(b, step);
var candidate_var: ?struct { name: []const u8, value: u64 } = null;
- var hay_it = mem.tokenize(u8, mem.trim(u8, haystack, " "), " ");
- var needle_it = mem.tokenize(u8, mem.trim(u8, phrase, " "), " ");
+ var hay_it = mem.tokenizeScalar(u8, mem.trim(u8, haystack, " "), ' ');
+ var needle_it = mem.tokenizeScalar(u8, mem.trim(u8, phrase, " "), ' ');
while (needle_it.next()) |needle_tok| {
const hay_tok = hay_it.next() orelse return false;
@@ -155,7 +155,7 @@ const Action = struct {
var op_stack = std.ArrayList(enum { add, sub, mod, mul }).init(gpa);
var values = std.ArrayList(u64).init(gpa);
- var it = mem.tokenize(u8, phrase, " ");
+ var it = mem.tokenizeScalar(u8, phrase, ' ');
while (it.next()) |next| {
if (mem.eql(u8, next, "+")) {
try op_stack.append(.add);
@@ -365,7 +365,7 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
var vars = std.StringHashMap(u64).init(gpa);
for (self.checks.items) |chk| {
- var it = mem.tokenize(u8, output, "\r\n");
+ var it = mem.tokenizeAny(u8, output, "\r\n");
for (chk.actions.items) |act| {
switch (act.tag) {
.match => {