奇怪的代码

  1. bool类型意义不明确
void MatchAndGameManager::SendReconnectRes( int gameid, int64 uid, bool **yesorno** )
{
    if ((gameid <= 0) || (uid <= 0))
    {
        return;
    }
    Event evt;
    TransEvent ev(&evt, Match_To_Game);
    MSG_MatchToGame * msg = ev->mutable_msg_mtg();
    msg->set_uid(uid);
    msg->set_result(!!yesorno);
    m_eh->sendEventToGamed(ev.Get(), MTG_EventCheckReconnect, gameid);
}

其他不用管,bool 起名yesorno简直。。。,和没有起名字一样,应该命名为isWin,hasInit等有意义的名字,另外加两个!!也是。。。

猜你喜欢

转载自blog.csdn.net/weixin_37098881/article/details/81394432