Skip to content

Commit 0d344f5

Browse files
committed
Got rid of one case Some statement with a fold
1 parent fbadf67 commit 0d344f5

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/main/scala/net/walend/graph/semiring/OnePathFirstStep.scala

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@ class OnePathFirstStep[Node,CoreLabel,Key](coreSupport:SemiringSupport[CoreLabel
1818

1919
def heapOrdering: HeapOrdering[Key] = coreSupport.heapOrdering
2020

21-
//todo use a fold
22-
// label.fold(coreSupport.heapOrdering.AlwaysBottom)(x => coreSupport.heapKeyForLabel(x.weight))
23-
24-
def heapKeyForLabel = {
25-
case Some(nextStep) => coreSupport.heapKeyForLabel(nextStep.weight)
26-
case None => coreSupport.heapOrdering.AlwaysBottom
27-
}
21+
def heapKeyForLabel:Label=>Key = _.fold(coreSupport.heapOrdering.AlwaysBottom)(x => coreSupport.heapKeyForLabel(x.weight))
2822

2923
case class FirstStep(weight:CoreLabel,step:Option[Node]) extends FirstStepTrait[Node,CoreLabel] {
3024
/**

0 commit comments

Comments
 (0)