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