-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Prevent unnecessary optimisation of already optimised Range Index expressions #4882
Conversation
2d1f6c4
to
77231a9
Compare
SonarCloud Quality Gate failed. 0 Bugs 72.5% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
if (expression instanceof final InternalFunctionCall fcall) { | ||
expression = fcall.getFunction(); | ||
} | ||
this.fallback = expression; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marmoure you may fix this Codacy issue by using a if /else block:
if (expression instanceof final InternalFunctionCall fcall) {
this.fallback = fcall.getFunction();
} else {
this.fallback = expression;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whilst the end result is the same. I am not sure this is the same intention, it was meant to be clear that we are replacing the expression
. @reinhapa How strongly do you feel about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I would like to somehow bring the total qualtiy issues down when they pop up as I think we should try to avoid new issues if possible...
if (expression instanceof final InternalFunctionCall fcall) { | ||
expression = fcall.getFunction(); | ||
} | ||
this.fallback = expression; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whilst the end result is the same. I am not sure this is the same intention, it was meant to be clear that we are replacing the expression
. @reinhapa How strongly do you feel about this?
This reverts commit 35a76f2.
…s.range.RangeQueryRewriter.rewriteLocationStep" This reverts commit 56e190a.
… is already optimized. Closes eXist-db#3624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks
Closes #3624
This PR prevents optimizing an already optimized expression.
It reverts the previous fix in PR #3625 as that PR causes eXist-db to do more work that necessary. This PR takes a simpler approach that requires less processing and less creation of objects by eXist-db (and therefore is faster and more memory efficient).
This open source contribution to the exist project was commissioned by the Office of the Historian, U.S. Department of State, https://history.state.gov/.