From bd494a8384ef3e46d6a9e5035c6cac750edcd270 Mon Sep 17 00:00:00 2001 From: Ilya Ryzhenkov Date: Thu, 21 Aug 2014 19:53:36 +0400 Subject: LinkedHashMap is now default for groupBy in stdlib. --- src/Formats/StructuredFormatService.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Formats/StructuredFormatService.kt') diff --git a/src/Formats/StructuredFormatService.kt b/src/Formats/StructuredFormatService.kt index 13af77ce..5ec86486 100644 --- a/src/Formats/StructuredFormatService.kt +++ b/src/Formats/StructuredFormatService.kt @@ -65,7 +65,7 @@ public abstract class StructuredFormatService(val locationService: LocationServi } open public fun appendLocation(to: StringBuilder, nodes: Iterable) { - val breakdownByName = nodes.groupByTo(LinkedHashMap()) { node -> node.name } + val breakdownByName = nodes.groupBy { node -> node.name } for ((name, items) in breakdownByName) { appendHeader(to, formatText(name)) appendSummary(to, items) @@ -74,7 +74,7 @@ public abstract class StructuredFormatService(val locationService: LocationServi } override fun appendNodes(to: StringBuilder, nodes: Iterable) { - val breakdownByLocation = nodes.groupByTo(LinkedHashMap()) { node -> + val breakdownByLocation = nodes.groupBy { node -> formatBreadcrumbs(node.path.map { link(node, it) }) } @@ -89,7 +89,7 @@ public abstract class StructuredFormatService(val locationService: LocationServi appendHeader(to, "Members", 3) val children = node.members.sortBy { it.name } - val membersMap = children.groupByTo(LinkedHashMap()) { link(node, it) } + val membersMap = children.groupBy { link(node, it) } appendTable(to) { appendTableBody(to) { @@ -99,7 +99,7 @@ public abstract class StructuredFormatService(val locationService: LocationServi appendText(to, formatLink(location)) } appendTableCell(to) { - val breakdownBySummary = members.groupByTo(LinkedHashMap()) { it.doc.summary } + val breakdownBySummary = members.groupBy { it.doc.summary } for ((summary, items) in breakdownBySummary) { if (!summary.isEmpty()) { appendText(to, formatText(summary)) -- cgit