Skip to content

Commit 778b9bc

Browse files
authored
chore: Remove dead code (#764)
1 parent c76b9e5 commit 778b9bc

8 files changed

+4
-45
lines changed

src/accumulator.rs

-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use accumulated::Accumulated;
1111
use accumulated::AnyAccumulated;
1212

1313
use crate::{
14-
cycle::CycleRecoveryStrategy,
1514
function::VerifyResult,
1615
ingredient::{fmt_index, Ingredient, Jar},
1716
plumbing::IngredientIndices,
@@ -118,10 +117,6 @@ impl<A: Accumulator> Ingredient for IngredientImpl<A> {
118117
true
119118
}
120119

121-
fn cycle_recovery_strategy(&self) -> CycleRecoveryStrategy {
122-
CycleRecoveryStrategy::Panic
123-
}
124-
125120
fn origin(&self, _db: &dyn Database, _key_index: crate::Id) -> Option<QueryOrigin> {
126121
None
127122
}

src/function.rs

+4-11
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub trait Configuration: Any {
5454
/// (and, if so, how).
5555
const CYCLE_STRATEGY: CycleRecoveryStrategy;
5656

57-
/// Invokes after a new result `new_value`` has been computed for which an older memoized value
57+
/// Invokes after a new result `new_value` has been computed for which an older memoized value
5858
/// existed `old_value`, or in fixpoint iteration. Returns true if the new value is equal to
5959
/// the older one.
6060
///
@@ -243,12 +243,9 @@ where
243243
/// True if the input `input` contains a memo that cites itself as a cycle head.
244244
/// This indicates an intermediate value for a cycle that has not yet reached a fixed point.
245245
fn is_provisional_cycle_head<'db>(&'db self, db: &'db dyn Database, input: Id) -> bool {
246-
self.get_memo_from_table_for(
247-
db.zalsa(),
248-
input,
249-
self.memo_ingredient_index(db.zalsa(), input),
250-
)
251-
.is_some_and(|memo| memo.cycle_heads().contains(&self.database_key_index(input)))
246+
let zalsa = db.zalsa();
247+
self.get_memo_from_table_for(zalsa, input, self.memo_ingredient_index(zalsa, input))
248+
.is_some_and(|memo| memo.cycle_heads().contains(&self.database_key_index(input)))
252249
}
253250

254251
/// Attempts to claim `key_index`, returning `false` if a cycle occurs.
@@ -265,10 +262,6 @@ where
265262
}
266263
}
267264

268-
fn cycle_recovery_strategy(&self) -> CycleRecoveryStrategy {
269-
C::CYCLE_STRATEGY
270-
}
271-
272265
fn origin(&self, db: &dyn Database, key: Id) -> Option<QueryOrigin> {
273266
self.origin(db.zalsa(), key)
274267
}

src/ingredient.rs

-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use std::{
55

66
use crate::{
77
accumulator::accumulated_map::{AccumulatedMap, InputAccumulatedValues},
8-
cycle::CycleRecoveryStrategy,
98
function::VerifyResult,
109
plumbing::IngredientIndices,
1110
table::Table,
@@ -117,11 +116,6 @@ pub trait Ingredient: Any + std::fmt::Debug + Send + Sync {
117116
/// Returns the [`IngredientIndex`] of this ingredient.
118117
fn ingredient_index(&self) -> IngredientIndex;
119118

120-
/// If this ingredient is a participant in a cycle, what is its cycle recovery strategy?
121-
/// (Really only relevant to [`crate::function::FunctionIngredient`],
122-
/// since only function ingredients push themselves onto the active query stack.)
123-
fn cycle_recovery_strategy(&self) -> CycleRecoveryStrategy;
124-
125119
/// Returns true if `reset_for_new_revision` should be called when new revisions start.
126120
/// Invoked once when ingredient is added and not after that.
127121
fn requires_reset_for_new_revision(&self) -> bool {

src/input.rs

-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ pub mod singleton;
1111
use input_field::FieldIngredientImpl;
1212

1313
use crate::{
14-
cycle::CycleRecoveryStrategy,
1514
function::VerifyResult,
1615
id::{AsId, FromIdWithDb},
1716
ingredient::{fmt_index, Ingredient},
@@ -233,10 +232,6 @@ impl<C: Configuration> Ingredient for IngredientImpl<C> {
233232
true
234233
}
235234

236-
fn cycle_recovery_strategy(&self) -> CycleRecoveryStrategy {
237-
CycleRecoveryStrategy::Panic
238-
}
239-
240235
fn origin(&self, _db: &dyn Database, _key_index: Id) -> Option<QueryOrigin> {
241236
None
242237
}

src/input/input_field.rs

-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use crate::cycle::CycleRecoveryStrategy;
21
use crate::function::VerifyResult;
32
use crate::ingredient::{fmt_index, Ingredient};
43
use crate::input::Configuration;
@@ -46,10 +45,6 @@ where
4645
self.index
4746
}
4847

49-
fn cycle_recovery_strategy(&self) -> CycleRecoveryStrategy {
50-
CycleRecoveryStrategy::Panic
51-
}
52-
5348
unsafe fn maybe_changed_after(
5449
&self,
5550
db: &dyn Database,

src/interned.rs

-4
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,6 @@ where
298298
true
299299
}
300300

301-
fn cycle_recovery_strategy(&self) -> crate::cycle::CycleRecoveryStrategy {
302-
crate::cycle::CycleRecoveryStrategy::Panic
303-
}
304-
305301
fn origin(&self, _db: &dyn Database, _key_index: crate::Id) -> Option<QueryOrigin> {
306302
None
307303
}

src/tracked_struct.rs

-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crossbeam_queue::SegQueue;
44
use tracked_field::FieldIngredientImpl;
55

66
use crate::{
7-
cycle::CycleRecoveryStrategy,
87
function::VerifyResult,
98
ingredient::{fmt_index, Ingredient, Jar},
109
key::{DatabaseKeyIndex, InputDependencyIndex},
@@ -753,10 +752,6 @@ where
753752
true
754753
}
755754

756-
fn cycle_recovery_strategy(&self) -> CycleRecoveryStrategy {
757-
crate::cycle::CycleRecoveryStrategy::Panic
758-
}
759-
760755
fn origin(&self, _db: &dyn Database, _key_index: crate::Id) -> Option<QueryOrigin> {
761756
None
762757
}

src/tracked_struct/tracked_field.rs

-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ where
4747
self.ingredient_index
4848
}
4949

50-
fn cycle_recovery_strategy(&self) -> crate::cycle::CycleRecoveryStrategy {
51-
crate::cycle::CycleRecoveryStrategy::Panic
52-
}
53-
5450
unsafe fn maybe_changed_after<'db>(
5551
&'db self,
5652
db: &'db dyn Database,

0 commit comments

Comments
 (0)