Skip to content
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

Merged
merged 3 commits into from
Jul 16, 2021
Merged

Conversation

stephentoub
Copy link
Member

I previously did a pass looking for opportunities. Finding a few more, as well as fixing some misuse of existing methods.

I previously did a pass looking for opportunities.  Finding a few more, as well as fixing some misuse of existing methods.
…oTests.cs

Co-authored-by: halgab <24685886+halgab@users.noreply.github.com>
@@ -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;
Copy link
Member

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.

Copy link
Member Author

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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

3 participants