Commit bf4d9cef authored by Chen Bill's avatar Chen Bill Committed by GitHub

use const reference (#2717)

parent 559c7277
...@@ -53,7 +53,7 @@ public: ...@@ -53,7 +53,7 @@ public:
bufferevent_write(client_bev, duel_client_write, 3); bufferevent_write(client_bev, duel_client_write, 3);
} }
template<typename ST> template<typename ST>
static void SendPacketToServer(unsigned char proto, ST& st) { static void SendPacketToServer(unsigned char proto, const ST& st) {
auto p = duel_client_write; auto p = duel_client_write;
if (sizeof(ST) > MAX_DATA_SIZE) if (sizeof(ST) > MAX_DATA_SIZE)
return; return;
......
...@@ -41,7 +41,7 @@ public: ...@@ -41,7 +41,7 @@ public:
bufferevent_write(dp->bev, net_server_write, 3); bufferevent_write(dp->bev, net_server_write, 3);
} }
template<typename ST> template<typename ST>
static void SendPacketToPlayer(DuelPlayer* dp, unsigned char proto, ST& st) { static void SendPacketToPlayer(DuelPlayer* dp, unsigned char proto, const ST& st) {
auto p = net_server_write; auto p = net_server_write;
if (sizeof(ST) > MAX_DATA_SIZE) if (sizeof(ST) > MAX_DATA_SIZE)
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment