contains method
Returns true, if the tree contains value
.
If supplied, compare
is used to compare value
with values already
present in the tree.
compare
must be consistent with the ordering of values already
present in this tree, but it may supply a more efficient implementation
of the comparison operation for this very invocation of contains.
Implementation
bool contains(T value, {int compare(T v1, T v2)?: null}) {
if (compare == null) {
compare = this._compare;
}
_require(compare is Function);
return _lookupNode(value, compare) != null;
}