Skip to content

Commit 88c955f

Browse files
mihaylovadriaanm
mihaylov
authored andcommitted
Implemented RichString as Seq[Char] and Ordered...
Implemented RichString as Seq[Char] and Ordered[String] and removed the superfluous implicit conversions from Predef
1 parent 665f097 commit 88c955f

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/library/scala/xml/ProcInstr.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ case class ProcInstr(target:String, proctext:String) extends SpecialNode {
3030

3131
final override def typeTag$:Int = -2;
3232

33-
val z:Seq[Char] = Predef.string2seq(target); z match {
33+
(target: Seq[Char]) match {
3434
case Seq('X'|'x','M'|'m','L'|'l') =>
3535
throw new IllegalArgumentException(target+" is reserved");
3636
case _ =>

src/library/scala/xml/Utility.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,7 @@ object Utility extends AnyRef with parsing.TokenTests {
295295
*/
296296
def appendEscapedQuoted(s: String, sb: StringBuilder) = {
297297
sb.append('"')
298-
val z:Seq[Char] = Predef.string2seq(s)
299-
for (val c <- z) c match {
298+
for (val c <- s) c match {
300299
case '"' => sb.append('\\'); sb.append('"')
301300
case _ => sb.append(c)
302301
}

src/library/scala/xml/parsing/TokenTests.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ trait TokenTests {
7272
*/
7373
def isName(s: String): Boolean = {
7474
if( s.length() > 0 ) {
75-
val z:Seq[Char] = Predef.string2seq(s);
76-
val y = z.elements;
75+
val y = s.elements;
7776
if (isNameStart(y.next)) {
7877
while (y.hasNext && isNameChar(y.next)) {};
7978
!y.hasNext
@@ -132,8 +131,7 @@ trait TokenTests {
132131
def checkPubID(s: String): Boolean = {
133132
//Console.println("checkPubID of \""+s+"\"");
134133
if (s.length() > 0) {
135-
val z: Seq[Char] = Predef.string2seq(s);
136-
val y = z.elements;
134+
val y = s.elements;
137135
var c = ' ';
138136
while (y.hasNext && isPubIDChar(c)) {
139137
//Console.println(c);

0 commit comments

Comments
 (0)