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
C++11 cleanup on constructors dir network #6021
Conversation
@@ -2031,8 +1981,7 @@ void ConnectionSendThread::sendAsPacket(u16 peer_id, u8 channelnum, | |||
} | |||
|
|||
ConnectionReceiveThread::ConnectionReceiveThread(unsigned int max_packet_size) : |
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.
max_packet_size isn't used, I remove it or can it be used in the near future?
src/network/connection.h
Outdated
@@ -625,7 +628,7 @@ class PeerHelper | |||
bool operator!=(void* ptr); | |||
|
|||
private: | |||
Peer* m_peer; | |||
Peer* m_peer = 0; |
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.
nullptr & check if NULL is tested on this variable
src/network/connection.h
Outdated
@@ -758,16 +748,21 @@ class Peer { | |||
float min_rtt; | |||
float max_rtt; | |||
float avg_rtt; | |||
|
|||
rttstats(float jitter_min_ = FLT_MAX, float jitter_max_ = 0.0f, float jitter_avg_ = -1.0f, |
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.
what is that ?
src/network/connection.cpp
Outdated
@@ -812,7 +812,7 @@ void Channel::UpdateTimers(float dtime,bool legacy_peer) | |||
PeerHelper::PeerHelper(Peer* peer) : | |||
m_peer(peer) | |||
{ | |||
if (peer != NULL) | |||
if (peer) | |||
{ |
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.
please fix braces too
👍 pending braces being fixed |
* C++11 cleanup on constructors dir network
* C++11 cleanup on constructors dir network
No description provided.