╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Issue.zig ────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
321 else 322 evt.currentMoment(repo_opts, repo)) catch return null; 323 const event_id_to_issue_cursor = (try moment.getCursor(hash.hashInt(repo_opts.hash, record_map_key))) orelse return null; 324 const event_id_to_issue = try DB.HashMap(.read_only).init(event_id_to_issue_cursor); 325 const issue_cursor = (try event_id_to_issue.getCursor(hash.hashInt(repo_opts.hash, id_bytes))) orelse return null; 326 const issue_map = try DB.HashMap(.read_only).init(issue_cursor); 327 return try evt.read(Record, DB, repo_opts.hash, arena, issue_map); 328 } 329 330 // remove an issue's order key from its labels' `status` sets, pruning entries 331 // whose set becomes empty 332 fn removeFromLabelSets( 333 comptime DB: type, 334 label_to_issues: DB.SortedMap(.read_write), 335 labels: []const u8, 336 status: Status, 337 order_key: []const u8, 338 ) !void { 339 var label_iter = labelIterator(labels); 340 while (label_iter.next()) |label| { 341 // skipped the same way consume skipped it, so it was never indexed 342 if (label.len == 0 or label.len > label_max_len) continue; 343 var key_buffer: LabelStatusKey = undefined; 344 const key = try labelStatusKey(&key_buffer, label, status); 345 const label_set_cursor = try label_to_issues.putCursor(key); 346 const label_set = try DB.SortedSet(.read_write).init(label_set_cursor); 347 _ = try label_set.remove(order_key); 348 if (0 == try label_set.count()) _ = try label_to_issues.remove(key); 349 } 350 } 351