Skip to content

Conversation

@JeremyKuhne
Copy link
Member

@JeremyKuhne JeremyKuhne commented Dec 7, 2023

This is an example of how nesting can be reduced. Basic techniques:

  • Inverting if blocks
  • Adding early outs
  • Moving larger blocks into nested functions

I updated a few additional types. Additionally:

  • Override Dispose(bool) on LinkLabel to ensure we release the GDI+ resources
  • Remove the null-forgiving operator from LinkLabel (without a major refactor)
Microsoft Reviewers: Open in CodeFlow

This is an example of how nesting can be reduced. Basic techniques:

- Inverting if blocks
- Adding early outs
- Moving larger blocks into nested functions

I updated a few additional types. Additionally:

- Override Dispose(bool) on LinkLabel to ensure we release the GDI+ resources
- Remove the null-forgiving operator from LinkLabel (without a major refactor)
@JeremyKuhne JeremyKuhne requested a review from a team as a code owner December 7, 2023 23:38
@ghost ghost assigned JeremyKuhne Dec 7, 2023
Tanya-Solyanik
Tanya-Solyanik previously approved these changes Dec 8, 2023
CreateTextFormatFlags(clientAreaMinusPadding.Size)
#if DEBUG
// Skip the asserts in TextRenderer because the DC has been modified
| TextRenderer.SkipAssertFlag
Copy link
Contributor

@Tanya-Solyanik Tanya-Solyanik Dec 8, 2023

Choose a reason for hiding this comment

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

This line should be indented. It might be more readable to put the #if DEBUG around the whole method call.

lonitra
lonitra previously approved these changes Dec 15, 2023
Copy link
Member

@lonitra lonitra left a comment

Choose a reason for hiding this comment

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

:shipit:

@JeremyKuhne JeremyKuhne merged commit 984a728 into dotnet:main Dec 15, 2023
@JeremyKuhne JeremyKuhne deleted the linklabel branch December 15, 2023 22:15
@ghost ghost added this to the 9.0 Preview1 milestone Dec 15, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants