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

Untag dispatch tree #2287

Merged
merged 5 commits into from
Mar 19, 2022
Merged

Conversation

AlexGuteniev
Copy link
Contributor

Towards #189

@AlexGuteniev AlexGuteniev requested a review from a team as a code owner October 20, 2021 19:12
stl/inc/xtree Outdated Show resolved Hide resolved
stl/inc/xtree Outdated Show resolved Hide resolved
Comment on lines +1629 to +1635
} else {
if constexpr (_Is_set) {
return _Buynode(_STD move(_Val));
} else {
return _Buynode(_STD move(const_cast<key_type&>(_Val.first)), _STD move(_Val.second));
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can flatten that into one else if

Suggested change
} else {
if constexpr (_Is_set) {
return _Buynode(_STD move(_Val));
} else {
return _Buynode(_STD move(const_cast<key_type&>(_Val.first)), _STD move(_Val.second));
}
}
} else if constexpr (_Is_set) {
return _Buynode(_STD move(_Val));
} else {
return _Buynode(_STD move(const_cast<key_type&>(_Val.first)), _STD move(_Val.second));
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think unflatten is more clear

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah not a hill I would die on, feel free to disregard

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure. I'll wait for other reviewers opinion.

Copy link
Member

Choose a reason for hiding this comment

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

They're pretty close, but I agree with Alex that the unflattened structure is clearer. The rationale is that this is a forked path, with a sub-fork, which is shown by the unflattened structure. It would be equally clear (ignoring our "prefer positive tests" convention) if the branches were reversed. Flattening the logic would make the order of the tests important, and having to worry about the order in which tests are performed is a slight mental burden.

Copy link
Contributor

Choose a reason for hiding this comment

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

I also have a mild preference to unflatten, so it's a tie, and the status quo code in the PR stays.

@StephanTLavavej StephanTLavavej added the throughput Must compile faster label Oct 20, 2021
@StephanTLavavej StephanTLavavej self-assigned this Nov 3, 2021
@StephanTLavavej StephanTLavavej removed their assignment Feb 18, 2022
@CaseyCarter CaseyCarter self-assigned this Feb 23, 2022
Comment on lines +1629 to +1635
} else {
if constexpr (_Is_set) {
return _Buynode(_STD move(_Val));
} else {
return _Buynode(_STD move(const_cast<key_type&>(_Val.first)), _STD move(_Val.second));
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I also have a mild preference to unflatten, so it's a tie, and the status quo code in the PR stays.

@CaseyCarter CaseyCarter removed their assignment Mar 16, 2022
@StephanTLavavej StephanTLavavej self-assigned this Mar 18, 2022
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 7312e5b into microsoft:main Mar 19, 2022
@StephanTLavavej
Copy link
Member

Thanks for improving the ordered associative containers! 🌲 🌳 🌴

@AlexGuteniev AlexGuteniev deleted the untag_dispatch_tree branch March 19, 2022 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
throughput Must compile faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants