src/WheelTimer.cpp
// Do lazy cancellation, so we can effectively use vector as container of timer nodes
Do lazy cancellation, so we can effectively use vector as container of timer nodes
Do lazy cancellation so we can effectively use vector as container of timer nodes
bool WheelTimer::Cancel(int id)
{
    TimerNode* node = ref_[id];
    if (node != nullptr)
    {
        node->slot = -1;
        size_--;
        return true;
    }
    return false;
}
bool WheelTimer :: Cancel ( int id ) { TimerNode * node = ref_ [ id ] ; if ( node != nullptr ) { node -> slot = -1 ; size_ -- ; return true ; } return false ; }
Do lazy cancellation, so we can effectively use vector as container of timer nodes
Do lazy cancellation so we can effectively use vector as container of timer nodes