Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3eac5c3

Browse files
committed
Optimize divisions and remainders by constants.
Following the techniques described in Hacker's Delight, Chapter 10.
1 parent 849495b commit 3eac5c3

File tree

7 files changed

+1607
-7
lines changed

7 files changed

+1607
-7
lines changed

ir/shared/src/main/scala/org/scalajs/ir/Trees.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ object Trees {
125125

126126
override def toString(): String =
127127
stats.mkString("Block(", ",", ")")
128+
129+
override def equals(that: Any): Boolean = that match {
130+
case that: Block => this.stats == that.stats
131+
case _ => false
132+
}
133+
134+
override def hashCode(): Int = stats.##
128135
}
129136

130137
object Block {

0 commit comments

Comments
 (0)