remove max_durability in favor of Durability::MAX

This commit is contained in:
Niko Matsakis 2019-07-05 05:58:23 -04:00
parent e4cca9b8ff
commit 87f8517d75
2 changed files with 6 additions and 10 deletions

View file

@ -35,13 +35,14 @@ impl Durability {
/// Example: the standard library or something from crates.io
pub const HIGH: Durability = Durability(2);
/// The maximum possible durability; equivalent to HIGH but
/// "conceptually" distinct (i.e., if we add more durability
/// levels, this could change).
pub(crate) const MAX: Durability = Self::HIGH;
/// Number of durability levels.
pub(crate) const LEN: usize = 3;
pub(crate) fn new(v: usize) -> Durability {
Durability(v as u8)
}
pub(crate) fn index(self) -> usize {
self.0 as usize
}

View file

@ -159,11 +159,6 @@ where
db.for_each_query(|query_storage| query_storage.sweep(db, strategy));
}
/// Returns the max durability, used for constants.
pub(crate) fn max_durability(&self) -> Durability {
Durability::new(self.shared_state.revisions.len() - 1)
}
/// The unique identifier attached to this `SalsaRuntime`. Each
/// snapshotted runtime has a distinct identifier.
#[inline]
@ -349,7 +344,7 @@ where
});
// Push the active query onto the stack.
let max_durability = self.max_durability();
let max_durability = Durability::MAX;
let active_query = self.local_state.push_query(database_key, max_durability);
// Execute user's code, accumulating inputs etc.