Skip to content

avoid creation of ListBuffers for Seq.empty and Seq()#8789

Merged
retronym merged 1 commit intoscala:2.12.xfrom
mkeskells:2.12.x_SeqList1
Mar 24, 2020
Merged

avoid creation of ListBuffers for Seq.empty and Seq()#8789
retronym merged 1 commit intoscala:2.12.xfrom
mkeskells:2.12.x_SeqList1

Conversation

@mkeskells
Copy link
Contributor

No description provided.

@scala-jenkins scala-jenkins added this to the 2.12.12 milestone Mar 6, 2020
@mkeskells mkeskells force-pushed the 2.12.x_SeqList1 branch 2 times, most recently from e7f067f to 32fac90 Compare March 6, 2020 16:21
Copy link
Member

@retronym retronym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the optimization into the inherited methods for binary compatibility.

@mkeskells
Copy link
Contributor Author

Move the optimization into the inherited methods for binary compatibility.

Reworked as suggested. Also reworked collection.Seq and added a test for that as in 2.12 Seq == collection.Seq, so user code with Seq.empty refers to collection.Seq.empty, not collection.immutable.seq.empty

@mkeskells mkeskells requested review from dwijnand and retronym March 23, 2020 11:34
@retronym retronym merged commit bb4d3e2 into scala:2.12.x Mar 24, 2020
hamzaremmal pushed a commit to hamzaremmal/scala3 that referenced this pull request May 2, 2025
avoid creation of ListBuffers for Seq.empty and Seq()
hamzaremmal pushed a commit to scala/scala3 that referenced this pull request May 7, 2025
avoid creation of ListBuffers for Seq.empty and Seq()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants