-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Use more string interpolation #55738
Conversation
I previously did a pass looking for opportunities. Finding a few more, as well as fixing some misuse of existing methods.
src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs
Outdated
Show resolved
Hide resolved
…oTests.cs Co-authored-by: halgab <24685886+halgab@users.noreply.github.com>
src/libraries/System.Linq.Expressions/tests/ILReader/FormatProvider.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Linq.Expressions/tests/ILReader/FormatProvider.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlDictionaryWriter.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Web.HttpUtility/src/System/Web/HttpUtility.cs
Outdated
Show resolved
Hide resolved
@@ -168,7 +168,7 @@ internal long CreationTime | |||
|
|||
private static string? s_instanceIdentifier; | |||
internal static string InstanceIdentifier => | |||
LazyInitializer.EnsureInitialized(ref s_instanceIdentifier, ref s_classSyncObject, () => Guid.NewGuid().ToString() + ":"); | |||
LazyInitializer.EnsureInitialized(ref s_instanceIdentifier, ref s_classSyncObject, () => $"{Guid.NewGuid()}:"); | |||
|
|||
// Double-checked locking pattern requires volatile for read/write synchronization | |||
private volatile bool _traceIdentifierInited; |
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.
String formatting using Convert.ToString a few lines below can use cleanup as well.
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.
Thanks. Looks like there's another handful of call sites. I'll merge this one and address Convert.ToString in a subsequent PR.
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
I previously did a pass looking for opportunities. Finding a few more, as well as fixing some misuse of existing methods.