-
Notifications
You must be signed in to change notification settings - Fork 898
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
assign value to a variable and return at the end. #18867
assign value to a variable and return at the end. #18867
Conversation
a010ff4
to
fc3ada3
Compare
Fixed `exp_find_by_token` method to return values correctly when finding token within an expression with mixed operators Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1660460
fc3ada3
to
070d143
Compare
Checked commit h-kataria@070d143 with ruby 2.3.3, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 spec/lib/miq_expression/subst_mixin_spec.rb
|
@bdunne made requested changes |
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.
Looks great! 👍
assign value to a variable and return at the end. (cherry picked from commit 0466cd6) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1720753
Hammer backport details:
|
exp.find do |e| | ||
result = exp_find_by_token(e, token) # Look for token | ||
end | ||
result |
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.
why not just
result = exp.find { |e| exp_find_by_token(e, token) }
Am I missing something?
Fixed
exp_find_by_token
method to return values correctly when finding token within an expression with mixed operatorsFixes https://bugzilla.redhat.com/show_bug.cgi?id=1660460
before
after
@gtanzillo @jrafanie please review
@dclarizio cc