Compare commits

...

2 Commits

Author SHA1 Message Date
Erik Innocent
6cbdbc9632
Merge 6ee0d2b7ac into fb54d8b549 2023-05-22 15:35:59 -07:00
Erik Innocent
6ee0d2b7ac Avoid raw get 2023-04-07 15:27:46 -07:00

View File

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