╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Issue.zig ────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
209 else 210 evt.currentMoment(repo_opts, repo)) catch return null; 211 const event_id_to_issue_cursor = (try moment.getCursor(hash.hashInt(repo_opts.hash, "event-id->issue"))) orelse return null; 212 const event_id_to_issue = try DB.HashMap(.read_only).init(event_id_to_issue_cursor); 213 const issue_cursor = (try event_id_to_issue.getCursor(hash.hashInt(repo_opts.hash, id_bytes))) orelse return null; 214 const issue_map = try DB.HashMap(.read_only).init(issue_cursor); 215 return try evt.read(@This(), DB, repo_opts.hash, arena, issue_map); 216 } 217 218 // remove an issue's order key from its tags' `status` sets, pruning entries 219 // whose set becomes empty 220 fn removeFromTagSets( 221 comptime DB: type, 222 tag_to_issues: DB.SortedMap(.read_write), 223 tags: []const u8, 224 status: Status, 225 order_key: []const u8, 226 ) !void { 227 var tag_iter = tagIterator(tags); 228 while (tag_iter.next()) |tag| { 229 if (tag.len == 0) continue; 230 var key_buffer: TagStatusKey = undefined; 231 const key = try tagStatusKey(&key_buffer, tag, status); 232 const tag_set_cursor = try tag_to_issues.putCursor(key); 233 const tag_set = try DB.SortedSet(.read_write).init(tag_set_cursor); 234 _ = try tag_set.remove(order_key); 235 if (0 == try tag_set.count()) _ = try tag_to_issues.remove(key); 236 } 237 } 238