1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

server.cpp: code modernization

* Use more for range based loops
* Simplify some tests
* Code style fixes
* connection.h: better PeerChange constructor instead of creating uninitalized object and then affect variables
This commit is contained in:
Loic Blot 2017-08-15 09:30:31 +02:00
parent 618e0dd417
commit 342e9336ae
No known key found for this signature in database
GPG key ID: EFAA458E8C153987
2 changed files with 31 additions and 40 deletions

View file

@ -586,6 +586,10 @@ enum PeerChangeType
};
struct PeerChange
{
PeerChange(PeerChangeType t, u16 _peer_id, bool _timeout):
type(t), peer_id(_peer_id), timeout(_timeout) {}
PeerChange() = delete;
PeerChangeType type;
u16 peer_id;
bool timeout;