Skip to content

Commit

Permalink
Minor cleanup in ScoreAggregator
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaro committed Dec 11, 2023
1 parent 01e9f9d commit c1e27bd
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class ScoreAggregator(

override fun toFlow(scope: CoroutineScope): Flow<Retrieved.RetrievedWithScore> =
input.toFlow(scope).map { retrieved ->
when {
retrieved is Retrieved.RetrievedWithScore -> retrieved//pass through
retrieved is Retrieved.RetrievedWithRelationship -> { //aggregate
when (retrieved) {
is Retrieved.RetrievedWithScore -> retrieved//pass through
is Retrieved.RetrievedWithRelationship -> { //aggregate

val scores =
retrieved.relationships.filter { rel -> rel.pred in this.relationshps && rel.obj.first == retrieved.id }
Expand All @@ -44,7 +44,6 @@ class ScoreAggregator(
}

else -> Retrieved.PlusScore(retrieved, 0f)

}
}

Expand Down

0 comments on commit c1e27bd

Please sign in to comment.