Skip to content

Commit d71d8e2

Browse files
authored
Remove dead code for ordering PreprocessedSources (#2103)
1 parent 7524d59 commit d71d8e2

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

modules/build/src/main/scala/scala/build/preprocessing/PreprocessedSource.scala

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -71,36 +71,4 @@ object PreprocessedSource {
7171
ScopePath.fromPath(path)
7272
def directivesPositions: None.type = None
7373
}
74-
75-
private def index(s: PreprocessedSource): Int =
76-
s match {
77-
case _: NoSourceCode => 0
78-
case _: InMemory => 1
79-
case _: OnDisk => 2
80-
}
81-
82-
implicit val ordering: Ordering[PreprocessedSource] =
83-
new Ordering[PreprocessedSource] {
84-
def compare(a: PreprocessedSource, b: PreprocessedSource): Int = {
85-
val aIdx = index(a)
86-
val bIdx = index(b)
87-
val idxCmp = aIdx.compare(bIdx)
88-
if (idxCmp == 0)
89-
(a, b) match {
90-
case (a0: NoSourceCode, b0: NoSourceCode) =>
91-
a0.path.toString.compareTo(b0.path.toString)
92-
case (a0: InMemory, b0: InMemory) =>
93-
(a0.reportingPath, b0.reportingPath) match {
94-
case (Left(ap), Left(bp)) => ap.compareTo(bp)
95-
case (Left(_), Right(_)) => -1
96-
case (Right(ap), Right(bp)) => ap.toString.compareTo(bp.toString)
97-
case (Right(_), Left(_)) => 1
98-
}
99-
case (a0: OnDisk, b0: OnDisk) => a0.path.toString.compareTo(b0.path.toString)
100-
case _ => ???
101-
}
102-
else idxCmp
103-
}
104-
}
105-
10674
}

0 commit comments

Comments
 (0)