From 818a8f4c081b9ea451cf906f016e52f692cbe733 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 16 Jul 2009 12:42:49 +0000 Subject: Two small performance fixes which shaved 40 sec... Two small performance fixes which shaved 40 seconds off clean->test time. --- src/compiler/scala/tools/nsc/symtab/Constants.scala | 2 +- src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/symtab/Constants.scala b/src/compiler/scala/tools/nsc/symtab/Constants.scala index 584eb65fdf..2231aa32e9 100644 --- a/src/compiler/scala/tools/nsc/symtab/Constants.scala +++ b/src/compiler/scala/tools/nsc/symtab/Constants.scala @@ -74,7 +74,7 @@ trait Constants { * @return ... */ override def equals(other: Any): Boolean = other match { - case that: Constant => this.value == that.value && this.tag == that.tag + case that: Constant => this.tag == that.tag && this.value == that.value case _ => false } diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index c4cfa2af53..9f042e5aa7 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -13,7 +13,7 @@ import scala.collection.immutable.{Map, ListMap} import scala.collection.mutable.{ListBuffer, ArrayBuffer} import scala.tools.nsc.io.AbstractFile import scala.tools.nsc.util.{Position, NoPosition} - +import scala.annotation.switch /** This abstract class implements a class file parser. * @@ -126,7 +126,7 @@ abstract class ClassfileParser { while (i < starts.length) { starts(i) = in.bp i += 1 - in.nextByte match { + (in.nextByte.toInt: @switch) match { case CONSTANT_UTF8 | CONSTANT_UNICODE => in.skip(in.nextChar) case CONSTANT_CLASS | CONSTANT_STRING => -- cgit v1.2.3