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

Static analysis: minor small changes #26946

Merged
merged 1 commit into from
Dec 9, 2021
Merged

Conversation

ajcvickers
Copy link
Member

Part of #26805

For example:

  • Assignment is not used
  • Redundant discard
  • Redundant explicit size in array creation
  • Convert field to local
  • Redundant verbatim prefix
  • Redundant lambda parens

@ajcvickers ajcvickers requested a review from a team December 8, 2021 15:12
@@ -951,8 +949,7 @@ private Expression GetGroupingKey(Expression key, List<Expression> groupingExpre

innerQueryExpression._clientProjections.Clear();

innerShaperExpression =
new ProjectionIndexRemappingExpressionVisitor(innerQueryExpression, this, indexMap).Visit(innerShaperExpression);
new ProjectionIndexRemappingExpressionVisitor(innerQueryExpression, this, indexMap).Visit(innerShaperExpression);
Copy link
Member

Choose a reason for hiding this comment

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

It's strange that the results are not used.
@smitpatel

Copy link
Contributor

Choose a reason for hiding this comment

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

the next line throws exception so this code path is not yet used. :trollface:

Copy link
Member

Choose a reason for hiding this comment

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

We should either undo the changes to remove this code

Copy link
Member Author

Choose a reason for hiding this comment

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

I wondered if the visitor might throw a different exception in some cases, and hence the code "does something" even though the next line is never reached. Nevertheless, I have reverted the change here.

Part of #26805

For example:
- Assignment is not used
- Redundant discard
- Redundant explicit size in array creation
- Convert field to local
- Redundant verbatim prefix
- Redundant lambda parens
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.

3 participants