diff options
author | Martin Odersky <odersky@gmail.com> | 2017-03-31 19:01:10 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-04-11 09:33:12 +0200 |
commit | a574ba6b70fc8a8dadf4ec493fcb5dc19d1fa478 (patch) | |
tree | 6203155dd48e40d5a56a5fa458660c6ee903427e /compiler/src/dotty/tools/dotc/core/Names.scala | |
parent | 4a54b2c24d6f6feb5864461697f5872df220ba52 (diff) | |
download | dotty-a574ba6b70fc8a8dadf4ec493fcb5dc19d1fa478.tar.gz dotty-a574ba6b70fc8a8dadf4ec493fcb5dc19d1fa478.tar.bz2 dotty-a574ba6b70fc8a8dadf4ec493fcb5dc19d1fa478.zip |
Further simplification for Name
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/Names.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/Names.scala | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Names.scala b/compiler/src/dotty/tools/dotc/core/Names.scala index 56bdb1623..95cc2fef7 100644 --- a/compiler/src/dotty/tools/dotc/core/Names.scala +++ b/compiler/src/dotty/tools/dotc/core/Names.scala @@ -101,11 +101,7 @@ object Names { def isEmpty: Boolean def startsWith(str: String): Boolean = firstPart.startsWith(str) - def startsWith(name: Name): Boolean = startsWith(name.toString) def endsWith(str: String): Boolean = lastPart.endsWith(str) - def endsWith(name: Name): Boolean = endsWith(name.toString) - def lastIndexOfSlice(str: String): Int = lastPart.toString.lastIndexOfSlice(str) - def lastIndexOfSlice(name: Name): Int = lastIndexOfSlice(name.toString) override def hashCode = System.identityHashCode(this) override def equals(that: Any) = this eq that.asInstanceOf[AnyRef] @@ -240,6 +236,8 @@ object Names { i } + def lastIndexOfSlice(str: String): Int = toString.lastIndexOfSlice(str) + override def replace(from: Char, to: Char): SimpleTermName = { val cs = new Array[Char](length) Array.copy(chrs, start, cs, 0, length) |