File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -187,11 +187,9 @@ private data class QueueItem(
187187private fun getShortestPathsForScope (nodes : Sequence <DependencyNode >): Map <Identifier , List <Identifier >> {
188188 // A node is visited if and only if it is a key in this map.
189189 val predecessorForVisitedNode = mutableMapOf<DependencyNode , DependencyNode ?>()
190- val queue = LinkedList <QueueItem >()
191190 // Keep track of the end-points of the shortest paths to speed up the re-construction.
192191 val firstVisitedNodeForId = mutableMapOf<Identifier , DependencyNode >()
193-
194- nodes.forEach { queue.offer(QueueItem (it.getStableReference(), null )) }
192+ val queue = nodes.mapTo(LinkedList ()) { QueueItem (it.getStableReference(), null ) }
195193
196194 while (queue.isNotEmpty()) {
197195 val item = queue.poll()
You can’t perform that action at this time.
0 commit comments