Skip to content

Fix signature handler regression #757

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

Merged
merged 2 commits into from
Sep 28, 2018

Conversation

rjmholt
Copy link
Contributor

@rjmholt rjmholt commented Sep 28, 2018

Fix a regression where we don't accumulate signatures we discover.

I've now read through both the LINQ PRs I merged looking for this problem and this is the only other instance I found.

@rjmholt rjmholt merged commit 0641bcf into PowerShell:master Sep 28, 2018
Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

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

After the fact but a comment nonetheless

foreach (ParameterInfo paramInfo in sig.Parameters)
var parameters = new ParameterInformation[parameterSets.Signatures[i].Parameters.Count()];
int j = 0;
foreach (ParameterInfo param in parameterSets.Signatures[i].Parameters)
Copy link
Member

Choose a reason for hiding this comment

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

Can you use another for loop here instead of foreach since you need the index j anyway?

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 had that first, but changed it back because the Parameters property is an IEnumerable - so it can't be indexed.

The foreach means we can iterate over it without extra effort.

@rjmholt rjmholt deleted the fix-linq-regressions branch December 12, 2018 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants