HangfireIO / Cronos

A fully-featured .NET library for working with Cron expressions. Built with time zones in mind and intuitively handles daylight saving time transitions
MIT License
1.01k stars 118 forks source link

Simplification of the `FindOccurrence` method #2

Closed odinserj closed 7 years ago

odinserj commented 7 years ago

Removed some duplicate execution paths, methods, statements. Next date is now calculated in a reverse order, starting from month, and only then we are searching for day. As an additional result, performance increased a bit.

After (sorry for images) image

Before image

codecov-io commented 7 years ago

Codecov Report

Merging #2 into master will decrease coverage by 0.2%. The diff coverage is 98.76%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #2      +/-   ##
==========================================
- Coverage   98.46%   98.25%   -0.21%     
==========================================
  Files           5        5              
  Lines         652      632      -20     
  Branches      209      202       -7     
==========================================
- Hits          642      621      -21     
  Misses          7        7              
- Partials        3        4       +1
Impacted Files Coverage Δ
src/Cronos/CalendarHelper.cs 100% <100%> (ø) :arrow_up:
src/Cronos/CronField.cs 100% <100%> (ø) :arrow_up:
src/Cronos/CronExpression.cs 99.14% <98.52%> (-0.23%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6facfb6...14c8e8e. Read the comment docs.