8000 Use List.fill instead of range · scala/scala@3106171 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3106171

Browse files
committed
Use List.fill instead of range
1 parent 229f499 commit 3106171

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ a 8000 bstract class ClassfileParser(reader: ReusableInstance[ReusableDataReader]) {
528528
val parentIndex = u2()
529529
val parentName = if (parentIndex == 0) null else pool.getClassName(parentIndex)
530530
val ifaceCount = u2()
531-
val ifaces = for (_ <- List.range(0, ifaceCount)) yield pool.getSuperClassName(index = u2())
531+
val ifaces = List.fill(ifaceCount.toInt)(pool.getSuperClassName(index = u2()))
532532
val completer = new ClassTypeCompleter(clazz.name, jflags, parentName, ifaces)
533533

534534
enterOwnInnerClasses()

src/library/scala/collection/Factory.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ trait IterableFactory[+CC[_]] extends Serializable {
146146
def newBuilder[A]: Builder[A, CC[A]]
147147

148148
/** Produces a $coll containing the results of some element computation a number of times.
149-
* @param n the number of elements contained in the $coll.
150-
* @param elem the element computation
151-
* @return A $coll that contains the results of `n` evaluations of `elem`.
152-
*/
149+
* @param n the number of elements contained in the $coll.
150+
* @param elem the element computation
151+
* @return A $coll that contains the results of `n` evaluations of `elem`.
152+
*/
153153
def fill[A](n: Int)(elem: => A): CC[A] = from(new View.Fill(n)(elem))
154154

155155
/** Produces a two-dimensional $coll containing the results of some element computation a number of times.

0 commit comments

Comments
 (0)
0