Created
April 5, 2022 04:17
-
-
Save katzkb/77f8bc4e95bb7d67bac94a36bfee4839 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val startTime = System.currentTimeMillis | |
val groupMap: Map[UserId, Seq[Group]] = | |
groupMemberSeq.groupBy(_.userId) map { case (userId, members) => | |
( | |
userId, | |
members.flatMap(member => | |
groupSeq.find(_.id == member.groupId) | |
) | |
) | |
} | |
val result: Seq[UserView] = userSeq.map(user => | |
UserView( | |
user.id, | |
user.name, | |
groupMap(user.id) | |
) | |
) | |
println((System.currentTimeMillis - startTime).toString + "ミリ秒") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment