From 115a192744c2c1f4422574ab32c39bb97edc6e7b Mon Sep 17 00:00:00 2001 From: realliujiaxu <72550220+realliujiaxu@users.noreply.github.com> Date: Fri, 12 Nov 2021 20:48:27 +0800 Subject: [PATCH] change sumBy to sumOf Iterable.sumBy is deprecated since Kotlin 1.5, change it to sumOf. --- Introduction to Coroutines and Channels/02_BlockingRequest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Introduction to Coroutines and Channels/02_BlockingRequest.md b/Introduction to Coroutines and Channels/02_BlockingRequest.md index 37fa8ce..b7da4b4 100644 --- a/Introduction to Coroutines and Channels/02_BlockingRequest.md +++ b/Introduction to Coroutines and Channels/02_BlockingRequest.md @@ -134,7 +134,7 @@ A possible solution: ```kotlin fun List.aggregate(): List = groupBy { it.login } - .map { (login, group) -> User(login, group.sumBy { it.contributions }) } + .map { (login, group) -> User(login, group.sumOf { it.contributions }) } .sortedByDescending { it.contributions } ```