Skip to content

Use interpolated string handler for Contract.ThrowIf methods#58173

Merged
sharwell merged 7 commits into
dotnet:mainfrom
Youssef1313:heavy-allocations
Feb 7, 2022
Merged

Use interpolated string handler for Contract.ThrowIf methods#58173
sharwell merged 7 commits into
dotnet:mainfrom
Youssef1313:heavy-allocations

Conversation

@Youssef1313
Copy link
Copy Markdown
Member

@Youssef1313 Youssef1313 commented Dec 7, 2021

Closes #58165

cc @333fred @sharwell @CyrusNajmabadi

I'm not sure if I'm doing it right

@Youssef1313 Youssef1313 requested review from a team as code owners December 7, 2021 20:21
@ghost ghost added Community The pull request was submitted by a contributor who is not a Microsoft employee. Area-Compilers labels Dec 7, 2021
Comment thread src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.cs Outdated
Comment thread src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.cs Outdated
Comment thread src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.cs Outdated
Comment thread src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/Contract.cs Outdated

public void AppendLiteral(string value) => _stringBuilder?.Append(value);

public void AppendFormatted<T2>(T2 value) => _stringBuilder?.Append(value?.ToString());
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Couldn't find good names for the type parameters.

@Youssef1313 Youssef1313 requested review from a team as code owners December 8, 2021 05:36
@Youssef1313 Youssef1313 force-pushed the heavy-allocations branch 2 times, most recently from fe7a3a7 to 78b91d8 Compare December 8, 2021 07:52
@Youssef1313
Copy link
Copy Markdown
Member Author

@333fred Anything left here?

@333fred
Copy link
Copy Markdown
Member

333fred commented Jan 4, 2022

@sharwell @dotnet/roslyn-ide for review.

@Youssef1313
Copy link
Copy Markdown
Member Author

@sharwell for review.

@Youssef1313
Copy link
Copy Markdown
Member Author

@sharwell Can you review please? Thanks!

Youssef1313 and others added 3 commits January 19, 2022 22:21
…ities/Contract.InterpolatedStringHandlers.cs

Co-authored-by: Sam Harwell <sam@tunnelvisionlabs.com>
…ities/Contract.InterpolatedStringHandlers.cs

Co-authored-by: Sam Harwell <sam@tunnelvisionlabs.com>
…ities/Contract.InterpolatedStringHandlers.cs

Co-authored-by: Sam Harwell <sam@tunnelvisionlabs.com>
Copy link
Copy Markdown
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

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

@dotnet/roslyn-compiler for a second review of the compiler files.

@333fred
Copy link
Copy Markdown
Member

333fred commented Jan 20, 2022

@jaredpar any more feedback?

@Youssef1313 Youssef1313 requested a review from jaredpar January 21, 2022 14:38
@Youssef1313
Copy link
Copy Markdown
Member Author

@jaredpar Can you take a look please? Thanks!

@sharwell sharwell merged commit cc888b2 into dotnet:main Feb 7, 2022
@ghost ghost added this to the Next milestone Feb 7, 2022
@Youssef1313 Youssef1313 deleted the heavy-allocations branch February 8, 2022 02:45
@RikkiGibson RikkiGibson modified the milestones: Next, 17.2.P2 Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Heavy allocation in formatting an unused error message

6 participants