@@ -246,48 +246,48 @@ where
246246 . prepared_index_evs
247247 . as_ref ( )
248248 . expect ( "should be set before 0 iteration" ) ;
249- if let Some ( id) = prepared_evs. primary_evs . first ( ) . map ( |ev| ev. id ( ) ) {
250- if !id. is_next_for ( last_ids. primary_id )
251- && last_ids. primary_id != IndexChangeEventId :: default ( )
252- {
253- let mut possibly_valid = false ;
254- if id. inner ( ) . overflowing_sub ( last_ids. primary_id . inner ( ) ) . 0 == 2 {
255- // TODO: for split sometimes this happens
256- let ev = prepared_evs. primary_evs . first ( ) . unwrap ( ) ;
257- if let ChangeEvent :: SplitNode { .. } = ev {
258- possibly_valid = true
259- }
260- if attempts > 8 {
261- possibly_valid = true
262- }
249+ if let Some ( id) = prepared_evs. primary_evs . first ( ) . map ( |ev| ev. id ( ) )
250+ && !id. is_next_for ( last_ids. primary_id )
251+ && last_ids. primary_id != IndexChangeEventId :: default ( )
252+ {
253+ let mut possibly_valid = false ;
254+ if id. inner ( ) . overflowing_sub ( last_ids. primary_id . inner ( ) ) . 0 == 2 {
255+ // TODO: for split sometimes this happens
256+ let ev = prepared_evs. primary_evs . first ( ) . unwrap ( ) ;
257+ if let ChangeEvent :: SplitNode { .. } = ev {
258+ possibly_valid = true
263259 }
264-
265- if !possibly_valid {
266- self . ops . extend ( ops_to_remove) ;
267- return Ok ( None ) ;
260+ if attempts > 8 {
261+ possibly_valid = true
268262 }
269263 }
264+
265+ if !possibly_valid {
266+ self . ops . extend ( ops_to_remove) ;
267+ return Ok ( None ) ;
268+ }
270269 }
271270 let secondary_first = prepared_evs. secondary_evs . first_evs ( ) ;
272271 for ( index, id) in secondary_first {
273272 let Some ( last) = last_ids. secondary_ids . get ( & index) else {
274273 continue ;
275274 } ;
276- if let Some ( id) = id {
277- if !id. is_next_for ( * last) && * last != IndexChangeEventId :: default ( ) {
278- let mut possibly_valid = false ;
279- if id. inner ( ) . overflowing_sub ( last. inner ( ) ) . 0 == 2 {
280- // TODO: for split sometimes this happens
281- possibly_valid = prepared_evs. secondary_evs . is_first_ev_is_split ( index) ;
282- if attempts > 8 {
283- possibly_valid = true
284- }
275+ if let Some ( id) = id
276+ && !id. is_next_for ( * last)
277+ && * last != IndexChangeEventId :: default ( )
278+ {
279+ let mut possibly_valid = false ;
280+ if id. inner ( ) . overflowing_sub ( last. inner ( ) ) . 0 == 2 {
281+ // TODO: for split sometimes this happens
282+ possibly_valid = prepared_evs. secondary_evs . is_first_ev_is_split ( index) ;
283+ if attempts > 8 {
284+ possibly_valid = true
285285 }
286+ }
286287
287- if !possibly_valid {
288- self . ops . extend ( ops_to_remove) ;
289- return Ok ( None ) ;
290- }
288+ if !possibly_valid {
289+ self . ops . extend ( ops_to_remove) ;
290+ return Ok ( None ) ;
291291 }
292292 }
293293 }
0 commit comments