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

Refactor WebBrowserContainer to replace HashTable and Enable Nullability #8226

Merged

Conversation

elachlan
Copy link
Contributor

@elachlan elachlan commented Nov 17, 2022

Refactored WebBrowserContainer to replace HashTable and Enable Nullability.

Related to #8143

Microsoft Reviewers: Open in CodeFlow

@elachlan elachlan requested a review from a team as a code owner November 17, 2022 22:51
@ghost ghost assigned elachlan Nov 17, 2022
string name = (ctl.Site is not null) ? ctl.Site.Name : ctl.Name;
return name ?? "";
}
=> ctl.Site is not null ? ctl.Site.Name ?? string.Empty : ctl.Name;
Copy link
Member

Choose a reason for hiding this comment

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

ctl.Name can not be null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This just condenses the existing logic. ctl.Name is only used when ctl.Site is null. Otherwise ctl.Site.Name is used and that can be null, so it returns string.Empy in that case.

Copy link
Member

Choose a reason for hiding this comment

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

right, earlier, we never return null. now we may be.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated it to check if ctl.Name is null and return string.empty. That should handle it.

@dreddy-work dreddy-work added the 📭 waiting-author-feedback The team requires more information from the author label Nov 18, 2022
@ghost ghost removed the 📭 waiting-author-feedback The team requires more information from the author label Nov 18, 2022
Copy link
Member

@dreddy-work dreddy-work left a comment

Choose a reason for hiding this comment

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

LGTM.

@dreddy-work dreddy-work added the ready-to-merge PRs that are ready to merge but worth notifying the internal team. label Nov 18, 2022
@dreddy-work dreddy-work merged commit 0a2b56d into dotnet:main Nov 18, 2022
@ghost ghost added this to the 8.0 Preview1 milestone Nov 18, 2022
@elachlan elachlan deleted the WebBrowserContainer-Remove-HashTable branch November 18, 2022 21:22
@ghost ghost locked as resolved and limited conversation to collaborators Dec 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ready-to-merge PRs that are ready to merge but worth notifying the internal team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants