Parallelize DFS, use an AtomicBool for short-circuiting
time: [73.407 µs 76.145 µs 79.345 µs] change: [−40.126% −24.679% −3.8062%] (p = 0.04 < 0.05)
This commit is contained in:
@@ -113,6 +113,16 @@ impl Default for Slot {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<u8> for Slot {
|
||||
fn from(value: u8) -> Self {
|
||||
let mut slot = Slot::default();
|
||||
for _ in 0..value {
|
||||
slot = slot.next()
|
||||
}
|
||||
slot
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, PartialEq, PartialOrd, Ord, Eq, Debug, Hash, Clone, Copy)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Day(pub u8);
|
||||
|
||||
Reference in New Issue
Block a user