-
Notifications
You must be signed in to change notification settings - Fork 21
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
consider revert #6755 because maybe Char + String is more efficient. #11025
Labels
Milestone
Comments
Write def x = "" + 'a' + "b" instead. |
Or just write "ab" :) In less trivial cases use the def foo(a: Char) = s"${a}b" public java.lang.String foo(char);
descriptor: (C)Ljava/lang/String;
flags: ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
0: new #18 // class java/lang/StringBuilder
3: dup
4: ldc #19 // int 1
6: invokespecial #23 // Method java/lang/StringBuilder."<init>":(I)V
9: iload_1
10: invokevirtual #27 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
13: ldc #29 // String b
15: invokevirtual #32 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
18: invokevirtual #36 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
21: areturn |
Should we recommend the |
I think that's an excellent idea. |
@exoego if you accept my invite to https://github.com/orgs/scala/teams/contributors/members, and comment here saying you did, I'll assign you this ticket |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
build.sbt
A.scala
sbt compile
logjavap -v target/scala-2.13.0-pre-4d39d4f/classes/A.class
The text was updated successfully, but these errors were encountered: