diff options
| author | Jack Koenig | 2018-05-24 14:12:45 -0700 |
|---|---|---|
| committer | GitHub | 2018-05-24 14:12:45 -0700 |
| commit | d64ee7dd5d536f043cbbae4f1d2a4a01c4ba91e8 (patch) | |
| tree | 7b24d0bcd68a5716aaad946e9361e788db78f083 /chiselFrontend/src/main | |
| parent | bffc8b9e851af88128f1c683e67634ebde25c14b (diff) | |
Remove extraneous traversal in cloneSupertype (#824)
Diffstat (limited to 'chiselFrontend/src/main')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/core/Data.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Data.scala b/chiselFrontend/src/main/scala/chisel3/core/Data.scala index 65f89cc1..e85bee42 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Data.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Data.scala @@ -108,7 +108,7 @@ private[core] object cloneSupertype { compileOptions: CompileOptions): T = { require(!elts.isEmpty, s"can't create $createdType with no inputs") - if (elts forall {_.isInstanceOf[Bits]}) { + if (elts.head.isInstanceOf[Bits]) { val model: T = elts reduce { (elt1: T, elt2: T) => ((elt1, elt2) match { case (elt1: Bool, elt2: Bool) => elt1 case (elt1: Bool, elt2: UInt) => elt2 // TODO: what happens with zero width UInts? @@ -130,7 +130,7 @@ private[core] object cloneSupertype { } case (elt1, elt2) => throw new AssertionError( - s"can't create $createdType with heterogeneous Bits types ${elt1.getClass} and ${elt2.getClass}") + s"can't create $createdType with heterogeneous types ${elt1.getClass} and ${elt2.getClass}") }).asInstanceOf[T] } model.cloneTypeFull } |
