Skip to content

Commit 72ea516

Browse files
committed
Simplify checking for cycles
1 parent 59845d3 commit 72ea516

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Property/WalkProperty.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ public function __construct(Walk $walk)
6161
*/
6262
public function isCycle()
6363
{
64-
$vertices = $this->walk->getVertices()->getVector();
65-
return (reset($vertices) === end($vertices) && !$this->walk->getEdges()->isEmpty());
64+
$vertices = $this->walk->getVertices();
65+
return ($vertices->getVertexFirst() === $vertices->getVertexLast() && !$this->walk->getEdges()->isEmpty());
6666
}
6767

6868
/**

0 commit comments

Comments
 (0)