File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -65,13 +65,11 @@ static inline _Py_BackoffCounter
6565restart_backoff_counter (_Py_BackoffCounter counter )
6666{
6767 assert (!is_unreachable_backoff_counter (counter ));
68- int backoff = counter .value_and_backoff & BACKOFF_MASK ;
69- if (backoff < MAX_BACKOFF ) {
70- return make_backoff_counter ((1 << (2 * backoff + 3 )) - 1 , backoff + 1 );
71- }
72- else {
73- return make_backoff_counter ((1 << (2 * MAX_BACKOFF + 1 )) - 1 , MAX_BACKOFF );
74- }
68+ uint16_t backoff = counter .value_and_backoff & BACKOFF_MASK ;
69+ assert (backoff <= MAX_BACKOFF );
70+ backoff = (backoff == MAX_BACKOFF ) ? backoff : backoff + 1 ;
71+ uint16_t value = (1 << (2 * backoff + 1 )) - 1 ;
72+ return make_backoff_counter (value , backoff );
7573}
7674
7775static inline _Py_BackoffCounter
You can’t perform that action at this time.
0 commit comments