From 342e9336ae145887f1c366b0863304b9db748cb8 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Tue, 15 Aug 2017 09:30:31 +0200 Subject: 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 --- src/network/connection.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/network') diff --git a/src/network/connection.h b/src/network/connection.h index 1ee4f6762..289c79125 100644 --- a/src/network/connection.h +++ b/src/network/connection.h @@ -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; -- cgit v1.2.3