Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid double-loop and branching for leap years
This avoids the variable-length array issue n #429. The previous implementation uses 'leap' to: * Run a full 'nyear' loop to populate whether each year is leap. * Run a second loop to count the number of days from the array (the branch prediction in each iteration will be wrong about half the time). Count the number of days directly in one loop. This is slightly more memory-efficient and should be more computationally efficient too. Closes #430. See #429.
- Loading branch information