contains method

bool contains(
  1. Path other
)

Whether other is this path or below it.

Implementation

bool contains(Path other) {
  final List<ChildKey> mine = segments;
  final List<ChildKey> theirs = other.segments;
  if (mine.length > theirs.length) {
    return false;
  }
  for (int i = 0; i < mine.length; i++) {
    if (mine[i] != theirs[i]) {
      return false;
    }
  }
  return true;
}