-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Turn simplify_function_body into a virtual method #4653
base: master
Are you sure you want to change the base?
Conversation
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.
Minor nits
@@ -567,7 +564,7 @@ Value FunctionCall::evaluate(const std::shared_ptr<const Context>& context) cons | |||
const Expression *expression = this; | |||
while (true) { | |||
try { | |||
auto result = simplify_function_body(expression, *expression_context); | |||
auto result = expression->simplify_function_body(*expression_context); // || Value::undefined.clone() |
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.
What's the purpose of the commented out code?
{ | ||
if (!expression) { | ||
const auto *call = 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.
Nit: Apart from retaining the old structure, does the call variable make this more readable, or does it makes sense to just use this
?
Didn't realize this was still a draft. Looks like a decent refactor to me. |
Does this not increase sizeof (Expression) for all expressions |
OK Apologies for the noise. . It shouldnt https://stackoverflow.com/questions/63557630/why-the-size-of-class-remains-same-on-adding-more-than-one-virtual-function |
No description provided.