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

Editorial: Rewrite DifferenceISODate as a clearer algorithm #2762

Merged
merged 1 commit into from Jan 30, 2024

Conversation

ptomato
Copy link
Collaborator

@ptomato ptomato commented Jan 30, 2024

The DifferenceISODate AO was a port from optimized JS to spec language, but was difficult to understand. Replace it with an algorithm that is written in an easier to understand way, but produces identical results (verified by testing a 1:1 implementation of the old and new algorithms on every possible pair of dates in a 4-year period.)

The reference code is also changed to match the AO more closely and be easier to understand, although some optimizations are made.

(This is the editorial part of #2759.)

The DifferenceISODate AO was a port from optimized JS to spec language,
but was difficult to understand. Replace it with an algorithm that is
written in an easier to understand way, but produces identical results
(verified by testing a 1:1 implementation of the old and new algorithms
on every possible pair of dates in a 4-year period.)

The reference code is also changed to match the AO more closely and be
easier to understand, although some optimizations are made.
Copy link

codecov bot commented Jan 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (35732cb) 96.73% compared to head (8b8ba20) 96.74%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2762   +/-   ##
=======================================
  Coverage   96.73%   96.74%           
=======================================
  Files          21       21           
  Lines       12444    12410   -34     
  Branches     2255     2236   -19     
=======================================
- Hits        12038    12006   -32     
+ Misses        349      347    -2     
  Partials       57       57           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@Ms2ger Ms2ger left a comment

Choose a reason for hiding this comment

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

Thanks!

@Ms2ger Ms2ger merged commit b918dc3 into main Jan 30, 2024
9 checks passed
@Ms2ger Ms2ger deleted the better-differenceisodate branch January 30, 2024 09:53
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.

None yet

2 participants