logic error removal (partial)
This commit is contained in:
parent
9d7f3f45d5
commit
36cdf9387f
2 changed files with 6 additions and 4 deletions
|
@ -258,14 +258,14 @@ impl Quarry {
|
||||||
|
|
||||||
async fn mark_done(&self, chunk: i32) {
|
async fn mark_done(&self, chunk: i32) {
|
||||||
let mut in_flight = self.in_flight.write().await;
|
let mut in_flight = self.in_flight.write().await;
|
||||||
let min = in_flight.iter().min() == Some(&chunk);
|
let min = in_flight.iter().max() == Some(&chunk);
|
||||||
|
|
||||||
in_flight.retain(|c| c != &chunk);
|
in_flight.retain(|c| c != &chunk);
|
||||||
|
|
||||||
if min { // make sure that head is no less than min
|
if min { // make sure that head is no less than min
|
||||||
loop {
|
loop {
|
||||||
let curr = self.head.load(Ordering::SeqCst);
|
let curr = self.confirmed.load(Ordering::SeqCst);
|
||||||
if let Ok(_) = self.head.compare_exchange(curr, curr.min(chunk), Ordering::AcqRel, Ordering::SeqCst) {
|
if let Ok(_) = self.confirmed.compare_exchange(curr, curr.max(chunk), Ordering::AcqRel, Ordering::SeqCst) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,7 @@ pub const TRANSPARENT: [&str; 3] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
/// Blocks that are fine to tunnel through
|
/// Blocks that are fine to tunnel through
|
||||||
const GARBAGE: [&str; 11] = [
|
const GARBAGE: [&str; 13] = [
|
||||||
"minecraft:stone",
|
"minecraft:stone",
|
||||||
"minecraft:dirt",
|
"minecraft:dirt",
|
||||||
"minecraft:andesite",
|
"minecraft:andesite",
|
||||||
|
@ -113,6 +113,8 @@ const GARBAGE: [&str; 11] = [
|
||||||
"minecraft:spruce_leaves",
|
"minecraft:spruce_leaves",
|
||||||
"minecraft:oak_leaves",
|
"minecraft:oak_leaves",
|
||||||
"traverse:fir_leaves",
|
"traverse:fir_leaves",
|
||||||
|
"wilderwild:brown_shelf_fungus",
|
||||||
|
"wilderwild:red_shelf_fungus",
|
||||||
];
|
];
|
||||||
|
|
||||||
/// time taken to go through uncharted territory (in turtle. calls)
|
/// time taken to go through uncharted territory (in turtle. calls)
|
||||||
|
|
Loading…
Reference in a new issue