-
Notifications
You must be signed in to change notification settings - Fork 530
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
Simplify timer operations #4032
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #4032 +/- ##
==========================================
+ Coverage 86.17% 86.78% +0.60%
==========================================
Files 56 56
Lines 16953 16929 -24
==========================================
+ Hits 14610 14691 +81
+ Misses 2343 2238 -105 ☔ View full report in Codecov by Sentry. |
Co-authored-by: Nick Banks <nibanks@microsoft.com>
Co-authored-by: Nick Banks <nibanks@microsoft.com>
|
||
if (Connection->EarliestExpirationTime == UINT64_MAX) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering how necessary this check is... It might be simpler just to remove it.
Description
The existing timer operations rely on a sorted timer entry array, where each entry has a type and expiration time, to maintain the earliest expiration time. However, it's not necessary to maintain a sorted array for this purpose. The earliest expiration time can be calculated on the fly when setting/canceling/expiring timers with the same complexity (it doesn't really matter as we only have a few timer types) and more readable code.
Testing
CI