╭ changed ─────────╮ │src/event/Repo.zig│ ╰──────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────╮ │77 pub const merge_policy: evt.MergePolicy = .target_wins;│ │78 pub const record_map_key = "event-id->repo"; │ │79 pub const all_id_set_key = "repo-id-set"; │ │80 -pub const active_id_set_key = "active-repo-id-set"; │ │80 pub const name_index_key = "name->repo-id"; │ │81 │ │82 pub fn validateName(name: []const u8) !void { │ ╰───────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │109 const event_id_to_repo_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, "event-id->repo"));│ │110 const event_id_to_repo = try DB.HashMap(.read_write).init(event_id_to_repo_cursor); │ │111 │ │113 - const name_to_repo_id_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, "name->repo-id")); │ │114 - const name_to_repo_id = try DB.HashMap(.read_write).init(name_to_repo_id_cursor); │ │112 + const name_to_repo_id_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, name_index_key)); │ │113 + const name_to_repo_id = try DB.SortedMap(.read_write).init(name_to_repo_id_cursor); │ │114 │ │115 var existing_record_maybe: ?Record = null; │ │116 const existing_cursor_maybe = try event_id_to_repo.getCursor(repo_key); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │134 │ │135 // drop the old active index; active values are re-added below │ │136 if (!existing_record.removed) { │ │138 - _ = try name_to_repo_id.remove(hash.hashInt(hash_kind, existing_record.event.name));│ │137 + _ = try name_to_repo_id.remove(existing_record.event.name); │ │138 } │ │139 } │ │140 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │152 try repo_id_set.put(&order_key); │ │153 } │ │154 │ │156 - // the user's repos, ordered by creation time, newest first │ │157 - const active = try DB.SortedSet(.read_write).init(try haxy_moment.putCursor(hash.hashInt(hash_kind, active_id_set_key)));│ │158 - if (record_to_write.removed) { │ │159 - _ = try active.remove(&order_key); │ │160 - } else { │ │161 - try active.put(&order_key); │ │162 - try name_to_repo_id.put(hash.hashInt(hash_kind, record_to_write.event.name), .{ .bytes = event_id }); │ │155 + if (!record_to_write.removed) { │ │156 + try name_to_repo_id.put(record_to_write.event.name, .{ .bytes = event_id }); │ │157 } │ │158 } │ │159 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │173 name: []const u8, │ │174 ) !?RepoWithId { │ │175 const name_to_repo_id_cursor = try user_moment.getCursor(hash.hashInt(hash_kind, name_index_key)) orelse return null;│ │182 - const name_to_repo_id = try DB.HashMap(.read_only).init(name_to_repo_id_cursor); │ │183 - const repo_id_cursor = try name_to_repo_id.getCursor(hash.hashInt(hash_kind, name)) orelse return null; │ │176 + const name_to_repo_id = try DB.SortedMap(.read_only).init(name_to_repo_id_cursor); │ │177 + const repo_id_cursor = try name_to_repo_id.getCursor(name) orelse return null; │ │178 var repo_id: [evt.event_id_size]u8 = undefined; │ │179 _ = try repo_id_cursor.readBytes(&repo_id); │ │180 const repo = (try readById(DB, hash_kind, user_moment, arena, &repo_id)) orelse return null; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯