-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Removed an unnecessary check in code which always evaluates to true #33710
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #33710 +/- ##
========================================
Coverage 64.14% 64.14%
========================================
Files 819 819
Lines 59160 59159 -1
========================================
Hits 37946 37946
+ Misses 21214 21213 -1
|
ruthra-kumar
approved these changes
Jan 21, 2023
@Mergifyio backport version-14-hotfix version-13-hotfix |
This was referenced Jan 21, 2023
✅ Backports have been created
|
deepeshgarg007
pushed a commit
that referenced
this pull request
Jan 21, 2023
…33710) fix: removed an unnecessary check which always evaluates to true
developmentforpeople
pushed a commit
to Ayuda-Efectiva/erpnext
that referenced
this pull request
Jan 26, 2023
…rappe#33710) fix: removed an unnecessary check which always evaluates to true
SaiFi0102
pushed a commit
to ServerManagementERPNext/erpnext
that referenced
this pull request
Feb 22, 2023
…rappe#33710) fix: removed an unnecessary check which always evaluates to true
Closed
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In file: deferred_revenue_and_expense.py, method: generate_report_data, a logical expression uses the identity operator. A new object is created inside the identity check operation and then used for matching identity. Since this is a distinct, new object, it will not have identity an match with anything else. As a result, the identity check will have a logical short circuit. Moreover in line 378, we already create an entry inside a list. So, the check for emptiness is unnecessary. Currently, the test expression in line 381 is passing all the time.
We removed that unnecessary test expression.