Skip to content

Commit

Permalink
small cleanups on the prev commit
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNineteen committed Dec 8, 2023
1 parent dfd85a0 commit bdf7eba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/gossip/crds_table.zig
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ pub const CrdsTable = struct {
}

// run this loop in parallel
for (self.pubkey_to_values.keys()[0..n_pubkeys], 0..n_pubkeys) |key, i| {
for (self.pubkey_to_values.keys()[0..n_pubkeys], 0..) |key, i| {
var old_labels = std.ArrayList(CrdsValueLabel).init(self.allocator);
tasks[i] = GetOldLabelsTask{
.key = key,
Expand Down
4 changes: 1 addition & 3 deletions src/gossip/gossip_service.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1116,8 +1116,7 @@ pub const GossipService = struct {

var output_limit = std.atomic.Atomic(i64).init(MAX_NUM_CRDS_VALUES_PULL_RESPONSE);

var task_index: usize = 0;
for (valid_indexs.items) |i| {
for (valid_indexs.items, 0..) |i, task_index| {
// create the thread task
tasks[task_index] = PullRequestTask{
.task = .{ .callback = PullRequestTask.callback },
Expand All @@ -1130,7 +1129,6 @@ pub const GossipService = struct {
.allocator = self.allocator,
.output_limit = &output_limit,
};
task_index += 1;

// run it
const batch = Batch.from(&tasks[task_index].task);
Expand Down

0 comments on commit bdf7eba

Please sign in to comment.