-
Notifications
You must be signed in to change notification settings - Fork 75
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
"White" AST search: Add to Sub mutation #677
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.
It would be nice if you can also reformat the code, it feels like in a couple of places something went wrong in this regard.
} | ||
bool compilationDatabaseInfoAvailable = bitcodeCompilationDatabaseAvailable || | ||
compilationDatabasePathAvailable || | ||
bitcodeCompilationFlagsAvailable; |
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.
Could you explain the need for these three extra variables? It feels a bit too noisy and adds more mental overhead than needed.
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.
This is the only comment where I want to make an argument for actually doing this.
We can make the variables a little bit shorter but they actually make making of decisions below very clear:
We only enter the "Junk detection" decision only if compilationDatabaseInfoAvailable
and we enter the "White search" decision if EnableASTSearch && compilationDatabaseInfoAvailable
.
Otherwise I would have to introduce a variable called whiteSearchIsEnabled
and put it where junkDetectionEnabled
is set to true
and we would have a duplication of both variables set to true to make their decisions.
This makes sense to me. For you?
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.
It does make sense to me, though there is a small misunderstanding on either side.
What I meant is to basically rename junkDetectionEnabled
into compilationDatabaseInfoAvailable
and drop the unnecessary variables. Then the same logic would be preserved, right?
I'm not going to die on this hill, so if having three extra variables works better for you, then I don't have any objections :)
No description provided.