Returns the number of key-value pairs
(x: Option<NonNull<Node<K, V>>>)
| 276 | |
| 277 | /// Returns the number of key-value pairs |
| 278 | pub fn calc_size<K, V>(x: Option<NonNull<Node<K, V>>>) -> usize { |
| 279 | x.map_or(0, |x| unsafe { |
| 280 | 1 + calc_size(x.as_ref().left) + calc_size(x.as_ref().right) |
| 281 | }) |
| 282 | } |
| 283 | |
| 284 | /// add the keys between lo and hi in the subtree rooted at x |
| 285 | /// to the queue |