aboutsummaryrefslogtreecommitdiff
path: root/lib/std/http/HeaderIterator.zig
diff options
context:
space:
mode:
authorAdriĆ  Arrufat <adria.arrufat@gmail.com>2025-12-04 11:10:30 +0900
committermlugg <mlugg@noreply.codeberg.org>2025-12-05 14:31:27 +0100
commit02c5f05e2f0e8e786f0530014e35c1520efd0084 (patch)
tree38b298fa7849d78c7d02294e7bd3b7aed2b7e52c /lib/std/http/HeaderIterator.zig
parent1a420a8dca34db8b632b0451d022ef92f78f96ac (diff)
downloadzig-02c5f05e2f0e8e786f0530014e35c1520efd0084.tar.gz
zig-02c5f05e2f0e8e786f0530014e35c1520efd0084.zip
std: replace usages of std.mem.indexOf with std.mem.find
Diffstat (limited to 'lib/std/http/HeaderIterator.zig')
-rw-r--r--lib/std/http/HeaderIterator.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/http/HeaderIterator.zig b/lib/std/http/HeaderIterator.zig
index 518950a9ab..0b20fd6906 100644
--- a/lib/std/http/HeaderIterator.zig
+++ b/lib/std/http/HeaderIterator.zig
@@ -5,17 +5,17 @@ is_trailer: bool,
pub fn init(bytes: []const u8) HeaderIterator {
return .{
.bytes = bytes,
- .index = std.mem.indexOfPosLinear(u8, bytes, 0, "\r\n").? + 2,
+ .index = std.mem.findPosLinear(u8, bytes, 0, "\r\n").? + 2,
.is_trailer = false,
};
}
pub fn next(it: *HeaderIterator) ?std.http.Header {
- const end = std.mem.indexOfPosLinear(u8, it.bytes, it.index, "\r\n").?;
+ const end = std.mem.findPosLinear(u8, it.bytes, it.index, "\r\n").?;
if (it.index == end) { // found the trailer boundary (\r\n\r\n)
if (it.is_trailer) return null;
- const next_end = std.mem.indexOfPosLinear(u8, it.bytes, end + 2, "\r\n") orelse
+ const next_end = std.mem.findPosLinear(u8, it.bytes, end + 2, "\r\n") orelse
return null;
var kv_it = std.mem.splitScalar(u8, it.bytes[end + 2 .. next_end], ':');