Skip to content

Commit

Permalink
Code golf
Browse files Browse the repository at this point in the history
  • Loading branch information
lenguyenthanh committed Mar 2, 2024
1 parent 0f54735 commit 1127173
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/RoundCrowd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ final class RoundCrowd(
)

def getUsers(roomId: RoomId): Set[User.Id] =
Option(rounds.get(roomId)).fold(Set.empty[User.Id])(_.room.users.keySet)
Option(rounds.get(roomId)).fold(Set.empty)(_.room.users.keySet)

def isPresent(roomId: RoomId, userId: User.Id): Boolean =
Option(rounds.get(roomId)).exists(_.room.users contains userId)
getUsers(roomId).contains(userId)

private def publish(roomId: RoomId, round: RoundState): Unit =
outputBatch(outputOf(roomId, round))
Expand Down

0 comments on commit 1127173

Please sign in to comment.