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

Inline no_major_solar_term into call sites to reduce duplicate work #4927

Merged
merged 1 commit into from
May 22, 2024

Conversation

sffc
Copy link
Member

@sffc sffc commented May 22, 2024

Split from #4904. This is a productive standalone change.

@sffc sffc requested a review from Manishearth May 22, 2024 16:07
@sffc sffc requested a review from a team as a code owner May 22, 2024 16:07
Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

LGTM, feel free to merge in whatever order works best for your PR

let solar_term_a = major_solar_term_from_fixed::<C>(month_after_eleventh);
let solar_term_b = major_solar_term_from_fixed::<C>(month_after_twelfth);
let solar_term_c = major_solar_term_from_fixed::<C>(month_after_thirteenth);
if lhs_argument == 12 && (solar_term_a == solar_term_b || solar_term_b == solar_term_c) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: mention in a comment that this is where the inlining of no_major_solar_term has happened so it's easier to compare algorithms

Copy link
Member Author

Choose a reason for hiding this comment

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

The inlining impacts the whole function because in addition to inlining no_major_solar_term, I'm also pre-calculating month_after_thirteenth, which was being calculated previously by no_major_solar_term and then again by this function. I'm not sure of the correct way to phrase an additional comment

@sffc sffc merged commit f5b1fcb into unicode-org:main May 22, 2024
30 checks passed
@sffc sffc deleted the inline-solar-term branch May 22, 2024 16:25
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.

2 participants