From b3e468a26e18e8d747789ea6336ccbc905b7fc2b Mon Sep 17 00:00:00 2001 From: Edmund Johnson Date: Tue, 1 May 2018 16:08:48 +0100 Subject: [PATCH] Remove unnecessary toSet() conversion in Fold solution --- Kotlin Koans/Collections/Fold/Solution.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kotlin Koans/Collections/Fold/Solution.kt b/Kotlin Koans/Collections/Fold/Solution.kt index 85e18ae..213e45f 100644 --- a/Kotlin Koans/Collections/Fold/Solution.kt +++ b/Kotlin Koans/Collections/Fold/Solution.kt @@ -6,6 +6,6 @@ fun Shop.getSetOfProductsOrderedByEveryCustomer(): Set { /**/val allProducts = customers.flatMap { it.orders.flatMap { it.products }}.toSet() return customers.fold(allProducts, { orderedByAll, customer -> - orderedByAll.intersect(customer.orders.flatMap { it.products }.toSet()) + orderedByAll.intersect(customer.orders.flatMap { it.products }) })/**/ } \ No newline at end of file