Skip to content

Editorial: Tweaks to UnbalanceDateDurationRelative#2678

Merged
Ms2ger merged 2 commits intomainfrom
editorial
Sep 25, 2023
Merged

Editorial: Tweaks to UnbalanceDateDurationRelative#2678
Ms2ger merged 2 commits intomainfrom
editorial

Conversation

@ptomato
Copy link
Copy Markdown
Collaborator

@ptomato ptomato commented Sep 21, 2023

These are pulled out of #2612 to make the normative diff smaller.

…llible

If we return before we do any calculations, then the _months_, _weeks_,
and _days_ quantities come directly from a previous Duration Record, so
they cannot cause CreateDateDurationRecord to fail.

Reverse the sense of the check in the _largestUnit_ = *"day"* clause so it
also becomes an early return and infallible.
Adding returns at the end of each largestUnit case makes it clearer that
some duration units are definitely zero when we return.
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 21, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (e7055b4) 96.22% compared to head (e2e0e18) 96.22%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2678   +/-   ##
=======================================
  Coverage   96.22%   96.22%           
=======================================
  Files          20       20           
  Lines       11986    11986           
  Branches     2227     2227           
=======================================
  Hits        11534    11534           
  Misses        389      389           
  Partials       63       63           

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

@Ms2ger Ms2ger merged commit 69a2c5b into main Sep 25, 2023
@Ms2ger Ms2ger deleted the editorial branch September 25, 2023 10:32
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