File tree 1 file changed +6
-6
lines changed
src/problem_1970_last_day_where_you_can_still_cross
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -8,17 +8,17 @@ use std::{mem, ptr};
8
8
type State = ( Cell < u16 > , Cell < u16 > ) ;
9
9
10
10
impl Solution {
11
- fn get_node ( array : & [ State ] , value : & State ) -> u16 {
12
- ( ( ptr:: from_ref ( value ) as usize - array . as_ptr ( ) as usize ) / mem:: size_of :: < State > ( ) ) as _
11
+ fn get_node ( union_find : & [ State ] , state : & State ) -> u16 {
12
+ ( ( ptr:: from_ref ( state ) as usize - union_find . as_ptr ( ) as usize ) / mem:: size_of :: < State > ( ) ) as _
13
13
}
14
14
15
- fn find_root < ' a > ( union_find : & ' a [ State ] , node_state : & ' a State ) -> & ' a State {
16
- let parent = node_state . 0 . get ( ) ;
15
+ fn find_root < ' a > ( union_find : & ' a [ State ] , state : & ' a State ) -> & ' a State {
16
+ let parent = state . 0 . get ( ) ;
17
17
18
- union_find. get ( usize:: from ( parent) ) . map_or ( node_state , |parent_state| {
18
+ union_find. get ( usize:: from ( parent) ) . map_or ( state , |parent_state| {
19
19
let root = Self :: find_root ( union_find, parent_state) ;
20
20
21
- node_state . 0 . set ( Self :: get_node ( union_find, root) ) ;
21
+ state . 0 . set ( Self :: get_node ( union_find, root) ) ;
22
22
23
23
root
24
24
} )
You can’t perform that action at this time.
0 commit comments