union method
Unions the sets containing the two given elements
Implements union by rank for optimal performance. If either element doesn't exist, this operation has no effect.
Implementation
@override
void union(T element1, T element2) {
final beforeSet1 = super.getSetSize(element1);
final beforeSet2 = super.getSetSize(element2);
super.union(element1, element2);
final afterSet1 = super.getSetSize(element1);
final afterSet2 = super.getSetSize(element2);
_recordOperation('union', element1, element2, {
'beforeSet1Size': beforeSet1,
'beforeSet2Size': beforeSet2,
'afterSet1Size': afterSet1,
'afterSet2Size': afterSet2,
});
_incrementOperationCount(element1);
_incrementOperationCount(element2);
}