Skip to content

Commit

Permalink
style: refactor according to ktlint
Browse files Browse the repository at this point in the history
  • Loading branch information
angelacorte committed Dec 2, 2024
1 parent 413ebe6 commit 257a413
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,11 @@ object NonSelfStabilizingGossip {
fun <ID : Any, Value> Aggregate<ID>.gossip(
value: Value,
aggregation: (Value, Value) -> Value,
): Value = share(value) {
it.fold(value, aggregation)
}
): Value = share(value) { it.fold(value, aggregation) }

/**
* A "gossip" algorithm that computes whether any device has ever experienced a certain [condition] before.
*/
fun <ID : Any> Aggregate<ID>.everHappened(
condition: () -> Boolean,
): Boolean = gossip(condition()) { a, b -> a || b }
fun <ID : Any> Aggregate<ID>.everHappened(condition: () -> Boolean): Boolean =
gossip(condition()) { a, b -> a || b }
}

0 comments on commit 257a413

Please sign in to comment.