╭ changed ───╮ │src/fork.zig│ ╰────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │18 id: [evt.event_id_size * 2]u8, │ │19 }; │ │20 │ │21 +// parse a "<forker>:<repo>+<patch id>" fork path │ │22 pub fn parseRoute(route_path: []const u8) ?Route { │ │22 - const patch_segment = "/patch:"; │ │23 - const patch_start = std.mem.indexOf(u8, route_path, patch_segment) orelse return null;│ │24 - const identity = route_path[0..patch_start]; │ │25 - const id_text = route_path[patch_start + patch_segment.len ..]; │ │23 + const plus = std.mem.indexOfScalar(u8, route_path, '+') orelse return null; │ │24 + const identity = route_path[0..plus]; │ │25 + const id_text = route_path[plus + 1 ..]; │ │26 if (identity.len == 0 or id_text.len != evt.event_id_size * 2) return null; │ │27 const id_bytes = evt.parseEventId(id_text) catch return null; │ │28 return .{ .identity = identity, .id = std.fmt.bytesToHex(id_bytes, .lower) }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯