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

Remove unnecessary checks for null #6214

Closed
wants to merge 2 commits into from
Closed

Remove unnecessary checks for null #6214

wants to merge 2 commits into from

Conversation

flash2048
Copy link
Contributor

@flash2048 flash2048 commented Feb 22, 2022

Fixes #minor

Description

In the code, a lot of things were checked for null twice.
I think it will be better to clean it.
It will improve readability and performance.

@flash2048 flash2048 requested a review from a team as a code owner February 22, 2022 22:56
@LeeParrishMSFT LeeParrishMSFT added the Automation: No parity PR does not need to be applied to other languages. label Feb 24, 2022
@BruceHaley
Copy link
Contributor

BruceHaley commented Mar 9, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@BruceHaley
Copy link
Contributor

Hi Andrei,
Unfortunately, required PR checks failed because the build pipelines failed to handle your fork properly.
Our fix to the pipelines has now been merged.
If you could do a "fetch upstream" and merge that fix into your branch, then we might get those PR checks to pass.
Thank you, and sorry for your trouble.
--Bruce

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@flash2048
Copy link
Contributor Author

BruceHaley

Hello, I did "fetch upstream" for it.

@gabog
Copy link
Contributor

gabog commented Mar 24, 2022

Thanks for the submission @flash2048, we agree that some of null checks are unnecessary, however some of the changes you are suggesting could potentially introduce changes in behavior and they are hard to test (e.g.: changing Value?.EvaluateExpression(dc.State); to Value.EvaluateExpression(dc.State); could potentially throw an NullReferenceException if Value is null).
We appreciate the contribution but we think it is too risky to take the PR as is at the moment without testing each feature individually and ensuring that removing the checks will not introduce bugs.

@gabog gabog closed this Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Automation: No parity PR does not need to be applied to other languages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants