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

Optimize DiffInMonths method #273

Merged
merged 1 commit into from
Dec 25, 2024
Merged

Optimize DiffInMonths method #273

merged 1 commit into from
Dec 25, 2024

Conversation

ritbrz
Copy link
Contributor

@ritbrz ritbrz commented Dec 25, 2024

The original implementation for DiffInMonths method used a recursive approach to calculate, which required a time complexity of O(n). By switching to a mathematical calculation, the time complexity is reduced to O(1).

@gouguoyin gouguoyin merged commit 9edc4c1 into dromara:master Dec 25, 2024
2 of 3 checks passed
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