@@ -2463,22 +2463,24 @@ where
2463
2463
/// Recursively sets the data of all nodes belonging to the subtree rooted at this node using the `compute_data`
2464
2464
/// function.
2465
2465
///
2466
+ /// Alternatively, sets values of all nodes when the value of a node is defined as a function of its prior value
2467
+ /// and values of its children (hence, it recursively depends on values of all descendants).
2468
+ ///
2466
2469
/// The `compute_data` function takes two arguments:
2467
2470
///
2468
2471
/// * current value (data) of this node, and
2469
- /// * slice of values of children of this node that are computed recursively using `compute_data` (*).
2472
+ /// * slice of values of children of this node that are computed recursively using `compute_data` (*);
2470
2473
///
2471
- /// Then, `compute_data` function reduces this node's current value and new values of its children to the new
2472
- /// value of this node.
2474
+ /// and then, computes the new value of this node.
2473
2475
///
2474
2476
/// The method is named *recursive* (*) due to the fact that,
2475
2477
///
2476
- /// * before computing the value of this node (or any of its descendants) ;
2477
- /// * values of all its children are computed and set using the `compute_data` function.
2478
+ /// * before computing the value of this node;
2479
+ /// * values of all of its children are also computed and set using the `compute_data` function.
2478
2480
///
2479
- /// *Note that this method does not actually make recursive method calls. Instead, it internally uses the [`PostOrder`]
2481
+ /// *Note that this method does ** not** actually make recursive method calls. Instead, it internally uses the [`PostOrder`]
2480
2482
/// traverser which ensures that all required values are computed before they are used for another computation. This
2481
- /// is a guard against potential stack overflow issues that could be observed in sufficiently large trees .*
2483
+ /// is a guard against potential stack overflow issues, and hence, can be used for trees of arbitrary depth .*
2482
2484
///
2483
2485
/// [`PostOrder`]: crate::PostOrder
2484
2486
///
@@ -2605,8 +2607,7 @@ where
2605
2607
let mut children_data = Vec :: < & V :: Item > :: new ( ) ;
2606
2608
2607
2609
for ptr in iter {
2608
- let x: NodePtr < _ > = ptr;
2609
- let node = unsafe { & mut * x. ptr_mut ( ) } ;
2610
+ let node = unsafe { & mut * ptr. ptr_mut ( ) } ;
2610
2611
let node_data = node. data ( ) . expect ( "is not closed" ) ;
2611
2612
2612
2613
for child_ptr in node. next ( ) . children_ptr ( ) {
0 commit comments