forked from scala/scala
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request scala#8789 from mkeskells/2.12.x_SeqList1
avoid creation of ListBuffers for Seq.empty and Seq()
- Loading branch information
Showing
4 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package scala.collection | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.junit.runners.JUnit4 | ||
|
||
import scala.tools.testing.AllocationTest | ||
|
||
@RunWith(classOf[JUnit4]) | ||
class SeqTest extends AllocationTest{ | ||
|
||
@Test def emptyNonAllocating(): Unit = { | ||
nonAllocating(Seq.empty) | ||
nonAllocating(Seq()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package scala.collection.immutable | ||
|
||
import org.junit.runner.RunWith | ||
import org.junit.runners.JUnit4 | ||
import org.junit.{Assert, Test} | ||
|
||
import scala.tools.testing.AllocationTest | ||
|
||
@RunWith(classOf[JUnit4]) | ||
class SeqTest extends AllocationTest{ | ||
|
||
@Test def emptyNonAllocating(): Unit = { | ||
nonAllocating(Seq.empty) | ||
nonAllocating(Seq()) | ||
} | ||
} |