Skip to content
This repository was archived by the owner on Sep 3, 2020. It is now read-only.

Commit af474be

Browse files
committed
Contains post review fixes.
1 parent d220e1f commit af474be

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/scala/scala/tools/refactoring/implementations/OrganizeImports.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ object OrganizeImports {
2222
val acc = distinctGroups.map(_ -> scala.collection.mutable.ListBuffer.empty[ImportT]).toMap
2323
val assigned = imports.foldLeft(acc) { (acc, imp) =>
2424
val expr = getImportExpression(imp)
25-
val (inGroup, _) = distinctGroups.partition { group =>
25+
val inGroup = distinctGroups.filter { group =>
2626
expr.startsWith(group + ".") || expr == group
2727
}
2828
if (inGroup.nonEmpty) {
@@ -33,8 +33,7 @@ object OrganizeImports {
3333
}
3434
val unassigned = {
3535
val a = assigned.values.toList.flatten.map(getImportExpression)
36-
val (_, unassigned) = imports.partition { imp => a.contains(getImportExpression(imp)) }
37-
unassigned
36+
imports.filterNot { imp => a.contains(getImportExpression(imp)) }
3837
}
3938
if (assigned.keySet(DefaultGroup)) {
4039
assigned(DefaultGroup) ++= unassigned

0 commit comments

Comments
 (0)