function isVisited(prevSegment) {
      return (
        visited[prevSegment.id] || segment.isLoopedPrevSegment(prevSegment)
      );
    }
Checks a given previous segment has been visited.
@param {CodePathSegment} prevSegment A previous segment to check.
@returns {boolean} `true` if the segment has been visited.