This commit is contained in:
Erik Innocent 2023-07-17 21:37:20 -05:00 committed by GitHub
commit 6654f8e9f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,21 +75,23 @@ class WorkerGetIntersectionHandler @Inject() (
val rightNeighborsOpt = val rightNeighborsOpt =
rightEdgeMap.get(featureType.rightEdgeType).flatMap(_.get(candidateId)) rightEdgeMap.get(featureType.rightEdgeType).flatMap(_.get(candidateId))
if (leftNeighborsOpt.isEmpty && rightNeighborsOpt.isEmpty) { (leftNeighborsOpt, rightNeighborsOpt) match {
EmptyWorkerIntersectionValue case (Some(leftNeighbors), None) =>
} else if (rightNeighborsOpt.isEmpty) { EmptyWorkerIntersectionValue.copy(
EmptyWorkerIntersectionValue.copy( leftNodeDegree = computeArraySize(leftNeighbors)
leftNodeDegree = computeArraySize(leftNeighborsOpt.get) )
) case (None, Some(rightNeighbors)) =>
} else if (leftNeighborsOpt.isEmpty) { EmptyWorkerIntersectionValue.copy(
EmptyWorkerIntersectionValue.copy( rightNodeDegree = computeArraySize(rightNeighbors)
rightNodeDegree = computeArraySize(rightNeighborsOpt.get) )
) case (Some(leftNeighbors), Some(rightNeighbors)) =>
} else { IntersectionValueCalculator(
IntersectionValueCalculator( leftNeighbors,
leftNeighborsOpt.get, rightNeighbors,
rightNeighborsOpt.get, request.intersectionIdLimit
request.intersectionIdLimit) )
case _ =>
EmptyWorkerIntersectionValue
} }
} }
} }