Skip to content

Commit

Permalink
propagate all collectibles
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Nov 12, 2024
1 parent ed72ab8 commit 79bba37
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl AggregatedDataUpdate {
let aggregation = get_aggregation_number(task);
let mut dirty_container_count = Default::default();
let mut collectibles_update: Vec<_> =
get_many!(task, Collectible { collectible } count if *count > 0 => (*collectible, 1));
get_many!(task, Collectible { collectible } count => (*collectible, *count));
if is_aggregating_node(aggregation) {
dirty_container_count = get!(task, AggregatedDirtyContainerCount)
.cloned()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,14 @@ impl Operation for CleanupOldEdgesOperation {
});
let mut task = ctx.task(task_id, TaskDataCategory::All);
for (collectible, count) in collectibles.iter_mut() {
if update_count!(
update_count!(
task,
Collectible {
collectible: *collectible
},
*count
) {
if *count > 0 {
*count = 1;
} else {
*count = -1;
}
} else {
*count = 0;
}
);
}
collectibles.retain(|(_, count)| *count != 0);
queue.extend(AggregationUpdateJob::data_update(
&mut task,
AggregatedDataUpdate::new().collectibles_update(collectibles),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,12 @@ impl UpdateCollectibleOperation {
// Not reduced from outdated
}
}
if count != 0 && update_count!(task, Collectible { collectible }, count) {
if count > 0 {
queue.extend(AggregationUpdateJob::data_update(
&mut task,
AggregatedDataUpdate::new().collectibles_update(vec![(collectible, 1)]),
));
} else {
queue.extend(AggregationUpdateJob::data_update(
&mut task,
AggregatedDataUpdate::new().collectibles_update(vec![(collectible, -1)]),
));
}
if count != 0 {
update_count!(task, Collectible { collectible }, count);
queue.extend(AggregationUpdateJob::data_update(
&mut task,
AggregatedDataUpdate::new().collectibles_update(vec![(collectible, count)]),
));
}

drop(task);
Expand Down

0 comments on commit 79bba37

Please sign in to comment.