-
-
Notifications
You must be signed in to change notification settings - Fork 262
Cleanup: get rid of req_null #8798
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
Conversation
src/jrd/fun.epp
Outdated
| if (!(input && (input->dsc_flags & DSC_null))) | ||
| *arg_ptr++ = nullptr; | ||
| else | ||
| { | ||
| *arg_ptr++ = input; | ||
| } | ||
| *arg_ptr++ = input; | ||
|
|
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.
Please revert the condition or maybe even simplify to:
*arg_ptr++ = (input && !input->isNull()) ? input : nullptr;
src/jrd/recsrc/FilteredStream.cpp
Outdated
|
|
||
| // select for ANY/ALL processing | ||
| const bool select_value = select_node->execute(tdbb, request); | ||
| const bool select_value = select_node->execute(tdbb, request).asBool(); |
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.
The returned value is not used outside the IF condition, so I'd move the whole function call inside IF.
| // look for a FALSE or null | ||
|
|
||
| if (!m_boolean->execute(tdbb, request)) | ||
| if (m_boolean->execute(tdbb, request) != TriState(true)) |
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.
| if (m_boolean->execute(tdbb, request) != TriState(true)) | |
| if (!m_boolean->execute(tdbb, request).asBool()) |
| return false; | ||
|
|
||
| if (m_boolean && !m_boolean->execute(tdbb, request)) | ||
| if (m_boolean && m_boolean->execute(tdbb, request) != TriState(true)) |
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.
| if (m_boolean && m_boolean->execute(tdbb, request) != TriState(true)) | |
| if (m_boolean && !m_boolean->execute(tdbb, request).asBool()) |
src/jrd/recsrc/FilteredStream.cpp
Outdated
|
|
||
| // select for ANY/ALL processing | ||
| const bool select_value = select_node->execute(tdbb, request); | ||
| const bool select_value = select_node->execute(tdbb, request).asBool(); |
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.
The returned value is not used outside the IF condition, so I'd move the whole function call inside IF.
| if (m_inversion) | ||
| { | ||
| if (!m_condition || !m_condition->execute(tdbb, tdbb->getRequest())) | ||
| if (!m_condition || m_condition->execute(tdbb, tdbb->getRequest()) != TriState(true)) |
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.
| if (!m_condition || m_condition->execute(tdbb, tdbb->getRequest()) != TriState(true)) | |
| if (!m_condition || !m_condition->execute(tdbb, tdbb->getRequest()).asBool()) |
| return false; | ||
|
|
||
| if (m_boolean && !m_boolean->execute(tdbb, request)) | ||
| if (m_boolean && m_boolean->execute(tdbb, request) != TriState(true)) |
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.
| if (m_boolean && m_boolean->execute(tdbb, request) != TriState(true)) | |
| if (m_boolean && !m_boolean->execute(tdbb, request).asBool()) |
src/dsql/BoolNodes.cpp
Outdated
| return false; | ||
| } | ||
| if (!desc[1]) | ||
| return !null2 && comparison < 0 ? TriState(false) : TriState::empty(); |
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.
| return !null2 && comparison < 0 ? TriState(false) : TriState::empty(); | |
| return (!null2 && comparison < 0) ? TriState(false) : TriState::empty(); |
src/dsql/BoolNodes.cpp
Outdated
| return false; | ||
| } | ||
| return cmp1_3; | ||
| return null2 && cmp1_3 ? TriState::empty() : TriState(cmp1_3); |
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.
| return null2 && cmp1_3 ? TriState::empty() : TriState(cmp1_3); | |
| return (null2 && cmp1_3) ? TriState::empty() : TriState(cmp1_3); |
src/dsql/BoolNodes.cpp
Outdated
| if (blrOp == blr_containing) | ||
| return obj->contains(*tdbb->getDefaultPool(), str, strLen, patternStr, patternLen); | ||
| return TriState(obj->contains(*tdbb->getDefaultPool(), | ||
| str, strLen, patternStr, patternLen)); |
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.
Here and below: please braces for the multi-line IF statement.
|
@dyemanov do you think For me, I understand the first only looking what |
|
More clear would be |
Honestly, I don't have any strong preference. If I understand what |
No description provided.