Skip to content

Commit

Permalink
name variable for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Sep 20, 2024
1 parent 26e98dc commit a480cf8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/scala/RoomCrowd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ final class RoomCrowd(json: CrowdJson, groupedWithin: util.GroupedWithin)(using
outputBatch(outputOf(roomId, room))

private val outputBatch = groupedWithin[Output](1024, 1.second): outputs =>
outputs
val lastPerRoomId: Iterable[Output] = outputs
.foldLeft(Map.empty[RoomId, Output]): (crowds, crowd) =>
crowds.updated(crowd.roomId, crowd)
.values
.foreach: output =>
json
.room(output)
.foreach:
Bus.publish(_.room(output.roomId), _)
lastPerRoomId.foreach: output =>
json
.room(output)
.foreach:
Bus.publish(_.room(output.roomId), _)

def size = rooms.size

Expand Down

0 comments on commit a480cf8

Please sign in to comment.