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 destructuring #1238

Merged
merged 1 commit into from
Dec 6, 2023
Merged

Use destructuring #1238

merged 1 commit into from
Dec 6, 2023

Conversation

drewnoakes
Copy link
Member

This language feature tidies up quite a few call sites. When code prefers use of var, there's no loss of type information.

This language feature tidies up quite a few call sites. When code prefers use of var, there's no loss of type information.
@@ -249,9 +247,8 @@ private async Task ProcessServiceChange(WatchEventType watchEventType, Service s
return;
}

foreach (var kvp in _resourceAssociatedServicesMap.Where(e => e.Value.Contains(service.Metadata.Name)))
foreach (var ((resourceKind, resourceName), _) in _resourceAssociatedServicesMap.Where(e => e.Value.Contains(service.Metadata.Name)))
Copy link
Member

Choose a reason for hiding this comment

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

I personally think using _resourceAssociatedServicesMap.Keys would be slightly more readable, but that's personal preference.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's not possible in this case, as it's filtering by value.

@drewnoakes drewnoakes merged commit 3ef216a into dotnet:main Dec 6, 2023
@drewnoakes drewnoakes deleted the destructuring branch December 6, 2023 20:16
@github-actions github-actions bot locked and limited conversation to collaborators Apr 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants