rebalanceAll method

void rebalanceAll()
inherited

Allows you to rebalance the whole tree. If you are dealing with non-deterministic compare functions, you probably need to consider rebalancing. If the result of the priority function for some elements changes, rebalancing is needed. In general, be careful with using comparing functions that can change. If only a few known elements need rebalancing, you can use rebalanceWhere. Note: rebalancing is not stable.

Implementation

void rebalanceAll() {
  final elements = toList(growable: false);
  clear();
  addAll(elements);
}