remove unused variables and functions

This commit is contained in:
XFFXFF 2022-09-24 00:20:03 +00:00
parent d71892c047
commit a2be847e1a
5 changed files with 7 additions and 16 deletions

View file

@ -71,7 +71,7 @@ where
}
}
};
let mut revisions = active_query.pop(runtime);
let mut revisions = active_query.pop();
// We assume that query is side-effect free -- that is, does
// not mutate the "inputs" to the query system. Sanity check

View file

@ -97,10 +97,6 @@ impl Runtime {
self.local_state.active_query()
}
pub(crate) fn empty_dependencies(&self) -> Arc<[DependencyIndex]> {
self.shared_state.empty_dependencies.clone()
}
pub fn snapshot(&self) -> Self {
if self.local_state.query_in_progress() {
panic!("it is not legal to `snapshot` during a query (see salsa-rs/salsa#80)");

View file

@ -3,7 +3,7 @@ use crate::{
hash::{FxIndexMap, FxIndexSet},
key::{DatabaseKeyIndex, DependencyIndex},
tracked_struct::Disambiguator,
Cycle, Revision, Runtime,
Cycle, Revision,
};
use super::local_state::{EdgeKind, QueryEdges, QueryOrigin, QueryRevisions};
@ -87,7 +87,7 @@ impl ActiveQuery {
self.input_outputs.contains(&(EdgeKind::Output, key))
}
pub(crate) fn revisions(&self, runtime: &Runtime) -> QueryRevisions {
pub(crate) fn revisions(&self) -> QueryRevisions {
let input_outputs = self.input_outputs.iter().copied().collect();
let edges = QueryEdges::new(input_outputs);

View file

@ -6,7 +6,6 @@ use crate::key::DependencyIndex;
use crate::runtime::Revision;
use crate::tracked_struct::Disambiguator;
use crate::Cycle;
use crate::Runtime;
use std::cell::RefCell;
use std::sync::Arc;
@ -339,14 +338,14 @@ impl ActiveQueryGuard<'_> {
/// which summarizes the other queries that were accessed during this
/// query's execution.
#[inline]
pub(crate) fn pop(self, runtime: &Runtime) -> QueryRevisions {
pub(crate) fn pop(self) -> QueryRevisions {
// Extract accumulated inputs.
let popped_query = self.complete();
// If this frame were a cycle participant, it would have unwound.
assert!(popped_query.cycle.is_none());
popped_query.revisions(runtime)
popped_query.revisions()
}
/// If the active query is registered as a cycle participant, remove and

View file

@ -1,9 +1,9 @@
use std::sync::{atomic::AtomicUsize, Arc};
use std::sync::atomic::AtomicUsize;
use crossbeam::atomic::AtomicCell;
use parking_lot::Mutex;
use crate::{durability::Durability, key::DependencyIndex, revision::AtomicRevision};
use crate::{durability::Durability, revision::AtomicRevision};
use super::dependency_graph::DependencyGraph;
@ -13,9 +13,6 @@ pub(super) struct SharedState {
/// Stores the next id to use for a snapshotted runtime (starts at 1).
pub(super) next_id: AtomicUsize,
/// Vector we can clone
pub(super) empty_dependencies: Arc<[DependencyIndex]>,
/// Set to true when the current revision has been canceled.
/// This is done when we an input is being changed. The flag
/// is set back to false once the input has been changed.
@ -47,7 +44,6 @@ impl SharedState {
fn with_durabilities(durabilities: usize) -> Self {
SharedState {
next_id: AtomicUsize::new(1),
empty_dependencies: None.into_iter().collect(),
revision_canceled: Default::default(),
revisions: (0..durabilities).map(|_| AtomicRevision::start()).collect(),
dependency_graph: Default::default(),