Skip to content

Commit

Permalink
isPathObstructed -> waitOnObstructor
Browse files Browse the repository at this point in the history
  • Loading branch information
krisl committed Oct 7, 2023
1 parent a0e8ca8 commit b0e7364
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ class Graferse<T>
) {
type NextNodes = (nextNodes: NextNode[], remaining: number) => void
return (byWhom: string) => {
const isPathObstructed = (destinationNode: T, encounteredLocks: Set<Lock>) => {
const waitOnObstructor = (destinationNode: T, encounteredLocks: Set<Lock>) => {
const lock = getLock(destinationNode)
const lastEncouteredLock = lock.isLockedByOtherThan(byWhom) ? lock
: Array.from(encounteredLocks).at(-1) || this.getLockedGroupLock(lock, byWhom)
Expand Down Expand Up @@ -325,7 +325,7 @@ class Graferse<T>
if (subpath.length < 2) {
// we ended our path on a bidir edge (likely a trolly location)
// fail, and wait on the last lock we encountered
if (isPathObstructed(pivotNode || subpath[0], encounteredLocks)) {
if (waitOnObstructor(pivotNode || subpath[0], encounteredLocks)) {
return false
}
return true
Expand All @@ -338,7 +338,7 @@ class Graferse<T>
if (linkLock instanceof OnewayLinkLock) {
console.debug(` ok - ${desc} not bidirectional`)
if (pivotNode) {
if (isPathObstructed(pivotNode, encounteredLocks)) {
if (waitOnObstructor(pivotNode, encounteredLocks)) {
return false
}
}
Expand Down

0 comments on commit b0e7364

Please sign in to comment.