Skip to content
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

#34 does not work correctly when host_triplet = target_triplet #72

Merged
merged 1 commit into from
May 14, 2021

Conversation

strega-nil
Copy link
Contributor

This fixes that bug

Comment on lines +308 to +317
bool excluded = false;
if (spec.triplet() == host_triplet)
{
return Util::Sets::contains(host_exclusions, spec.name());
excluded = excluded || Util::Sets::contains(host_exclusions, spec.name());
}
else
if (spec.triplet() == target_triplet)
{
return Util::Sets::contains(exclusions, spec.name());
excluded = excluded || Util::Sets::contains(exclusions, spec.name());
}
return excluded;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My optimizer brain hates mixing the control flow domain and the value domain. (Saying 'perf doesn't matter here leave me alone Bill' is a totally OK response :))

How about:

auto&& triplet = spec.triplet();
auto&& name = spec.name();
return (triplet == host_triplet && Util::Sets::contains(host_exclusions, name))
    || (triplet == target_triplet && Util::Sets::contains(exclusions, name));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perf doesn't matter here leave me alone bill ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest I find the return expression a bit clearer too but 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants