Commit 0a3f53b4 authored by Tobias Koppers's avatar Tobias Koppers Committed by Luke Sandberg

remove negative count handling as unsigned ints can't be negative

parent 19dcd133
use std::{ use std::{
cmp::{Ordering, max}, cmp::max,
collections::{VecDeque, hash_map::Entry as HashMapEntry}, collections::{VecDeque, hash_map::Entry as HashMapEntry},
hash::Hash, hash::Hash,
mem::take, mem::take,
...@@ -1284,9 +1284,7 @@ impl AggregationUpdateQueue { ...@@ -1284,9 +1284,7 @@ impl AggregationUpdateQueue {
if should_be_inner { if should_be_inner {
// remove all follower edges // remove all follower edges
let count = upper.remove_followers(&task_id).unwrap_or_default(); let count = upper.remove_followers(&task_id).unwrap_or_default();
match count.cmp(&0) { if count != 0 {
std::cmp::Ordering::Less => upper.add_followers(task_id, count),
std::cmp::Ordering::Greater => {
#[cfg(feature = "trace_aggregation_update")] #[cfg(feature = "trace_aggregation_update")]
let _span = trace_span!("make inner").entered(); let _span = trace_span!("make inner").entered();
...@@ -1350,14 +1348,10 @@ impl AggregationUpdateQueue { ...@@ -1350,14 +1348,10 @@ impl AggregationUpdateQueue {
} }
} }
} }
std::cmp::Ordering::Equal => {}
}
} else if should_be_follower { } else if should_be_follower {
// Remove the upper edge // Remove the upper edge
let count = task.remove_upper(&upper_id).unwrap_or_default(); let count = task.remove_upper(&upper_id).unwrap_or_default();
match count.cmp(&0) { if count != 0 {
Ordering::Less => task.add_upper(upper_id, count),
Ordering::Greater => {
#[cfg(feature = "trace_aggregation_update")] #[cfg(feature = "trace_aggregation_update")]
let _span = trace_span!("make follower").entered(); let _span = trace_span!("make follower").entered();
...@@ -1413,8 +1407,6 @@ impl AggregationUpdateQueue { ...@@ -1413,8 +1407,6 @@ impl AggregationUpdateQueue {
); );
} }
} }
Ordering::Equal => {}
}
} else { } else {
#[cfg(feature = "trace_aggregation_update")] #[cfg(feature = "trace_aggregation_update")]
let _span = trace_span!("conflict").entered(); let _span = trace_span!("conflict").entered();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment