remove method
Removes value
from the set.
Returns true
if value
was in the set, and false
if not.
The method has no effect if value
was not in the set.
If value
requires removal multiple times, the required removal counter
is decremented. Otherwise, value
is removed.
Implementation
@override
bool remove(Object? value) {
if (!_inner.contains(value)) return false;
final newCount = _counts[value]! - 1;
if (newCount == 0) {
_inner.remove(value);
_counts.remove(value);
} else {
_counts[value as E] = newCount;
}
return true;
}