File tree 2 files changed +11
-28
lines changed
2 files changed +11
-28
lines changed Original file line number Diff line number Diff line change @@ -119,16 +119,6 @@ impl CycleHeads {
119
119
. any ( |head| head. database_key_index == * value)
120
120
}
121
121
122
- pub ( crate ) fn contains_at_iteration (
123
- & self ,
124
- database_key_index : DatabaseKeyIndex ,
125
- iteration_count : u32 ,
126
- ) -> bool {
127
- self . into_iter ( ) . any ( |head| {
128
- head. database_key_index == database_key_index && head. iteration_count == iteration_count
129
- } )
130
- }
131
-
132
122
pub ( crate ) fn remove ( & mut self , value : & DatabaseKeyIndex ) -> bool {
133
123
let Some ( cycle_heads) = & mut self . 0 else {
134
124
return false ;
@@ -144,10 +134,6 @@ impl CycleHeads {
144
134
true
145
135
}
146
136
147
- pub ( crate ) fn len ( & self ) -> usize {
148
- self . 0 . as_ref ( ) . map ( |heads| heads. len ( ) ) . unwrap_or_default ( )
149
- }
150
-
151
137
pub ( crate ) fn update_iteration_count (
152
138
& mut self ,
153
139
cycle_head_index : DatabaseKeyIndex ,
Original file line number Diff line number Diff line change @@ -276,21 +276,18 @@ where
276
276
"{database_key_index:?}: validate_same_iteration(memo = {memo:#?})" ,
277
277
memo = memo. tracing_debug( )
278
278
) ;
279
-
280
- let heads = & memo. revisions . cycle_heads ;
281
- let num_heads = heads. len ( ) ;
282
- db. zalsa_local ( ) . with_query_stack ( |stack| {
283
- let mut found = 0 ;
284
- for entry in stack. iter ( ) {
285
- if heads. contains_at_iteration ( entry. database_key_index , entry. iteration_count ) {
286
- found += 1 ;
287
- if found == num_heads {
288
- return true ;
289
- }
290
- }
279
+ for cycle_head in & memo. revisions . cycle_heads {
280
+ if !db. zalsa_local ( ) . with_query_stack ( |stack| {
281
+ stack. iter ( ) . any ( |entry| {
282
+ entry. database_key_index == cycle_head. database_key_index
283
+ && entry. iteration_count == cycle_head. iteration_count
284
+ } )
285
+ } ) {
286
+ return false ;
291
287
}
292
- false
293
- } )
288
+ }
289
+
290
+ true
294
291
}
295
292
296
293
/// VerifyResult::Unchanged if the memo's value and `changed_at` time is up-to-date in the
You can’t perform that action at this time.
0 commit comments