We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 843ec4f commit 10ea712Copy full SHA for 10ea712
src/dotty/tools/dotc/core/Names.scala
@@ -352,9 +352,9 @@ object Names {
352
def compare(x: Name, y: Name): Int = {
353
if (x.isTermName && y.isTypeName) 1
354
else if (x.isTypeName && y.isTermName) -1
355
- else if (x.start == y.start && x.length == y.length) 0
+ else if (x eq y) 0
356
else {
357
- val until = Math.min(x.length, y.length)
+ val until = x.length min y.length
358
var i = 0
359
360
while (i < until && x(i) == y(i)) i = i + 1
@@ -363,9 +363,7 @@ object Names {
363
if (x(i) < y(i)) -1
364
else /*(x(i) > y(i))*/ 1
365
} else {
366
- if (x.length < y.length) 1
367
- else if (x.length > y.length) -1
368
- else 0 // shouldn't happen, but still
+ x.length - y.length
369
}
370
371
0 commit comments