-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Avoid some intermediate List
s
#18572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid some intermediate List
s
#18572
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
@@ -2132,7 +2132,7 @@ class Definitions { | |||
if (!isInitialized) { | |||
// force initialization of every symbol that is synthesized or hijacked by the compiler | |||
val forced = | |||
syntheticCoreClasses ++ syntheticCoreMethods ++ ScalaValueClasses() :+ JavaEnumClass | |||
syntheticCoreClasses ::: syntheticCoreMethods ++ ScalaValueClasses() :+ JavaEnumClass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is a bit strange. Maybe we could force them in a simpler way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I mechanically edited the code without realizing what it was used for.
I changed it to just reference the lists.
ScalaValueClasses()
doesn't need to be initialized since it's not a lazy val
, so I removed it. Let me know if I'm wrong.
989c961
I don't think we should bother with this. List.++ calls directly calls concat, which is overridden in List to match the suffix (the argument) to List and then call :::. So we're removing that overhead, which is constant, so not worth it. |
Oh, it goes through |
Co-authored-by: Nicolas Stucki <[email protected]>
:::
instead of ++
to concatenate List
sList
s
How about replacing usage of |
I dropped the change from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine now
The call to `apply` perform side effects that need to be executed
Backports #18572 to the LTS branch. PR submitted by the release tooling. [skip ci]
Backports #18572 to the LTS branch. PR submitted by the release tooling. [skip ci]
No description provided.