operator == method

  1. @override
bool operator ==(
  1. Object other
)
override

Implements equality based on if the other is a Node and the data is equal.

Implementation

// TODO: Discuss why not simply leveraging the type system to only allow
// [Node] instances as [other]?
@override
bool operator ==(Object other) {
  if (other is Node) {
    return data == other.data;
  }
  return false;
}