-
Notifications
You must be signed in to change notification settings - Fork 67
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
improving codeCov for #22 #82
Conversation
Codecov Report
@@ Coverage Diff @@
## main #82 +/- ##
==========================================
+ Coverage 30.35% 31.07% +0.72%
==========================================
Files 97 97
Lines 4191 4187 -4
Branches 661 660 -1
==========================================
+ Hits 1272 1301 +29
+ Misses 2676 2645 -31
+ Partials 243 241 -2
Continue to review full report at Codecov.
|
do { | ||
msgIdEntry.nextMsgId++; | ||
if (msgIdEntry.nextMsgId > MAX_MSG_ID) { | ||
msgIdEntry.nextMsgId = MIN_MSG_ID; | ||
} | ||
if (msgIdEntry.nextMsgId == startingMessageId) { | ||
loopCount++; | ||
if (loopCount >= maxLoopCount) { |
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 think this is not necessary, the if judgment will absolutely happen when the 'loopCount' plus
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.
Yes, it may be the case that maxLoopCount>1 was considered before
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.
in the old code, the var maxLoopCount=2, but it may be cause the getNextId become slow ,then hang the thread
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.
Under most cases, the method 'releaseId' which release 'inUseMsgIds' is enough, unless lots of message accumulation happens. Once the extreme case occurs, i think it makes no difference/sense to run the loop once or twice.
so may I remove the loop judgment and keep this change? @pingww @tianliuliu
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.
Under most cases, the method 'releaseId' which release 'inUseMsgIds' is enough, unless lots of message accumulation happens. Once the extreme case occurs, i think it makes no difference/sense to run the loop once or twice.
so may I remove the loop judgment and keep this change? @pingww @tianliuliu
you are right. the cause is exactly it.
continuously enhancing #22