From 5edec30db00ae10dbf4744bb89e3e5ffd43271fa Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 6 Jun 2017 16:40:48 -0700 Subject: [PATCH] Merge #10523: Perform member initialization in initialization lists where possible 656dbd871 Perform member initialization in initialization lists where possible (practicalswift) Tree-SHA512: 048380f4da23ab1eaaf471801a01dbd76f2235afb686c1489b30a6bac109195134afc83414b8378d3482a9042d537ec62d30136dadb9347cf06b07fb5c693208 --- src/primitives/block.h | 5 +---- src/protocol.cpp | 6 +----- src/rpc/server.h | 2 +- src/wallet/wallet.h | 5 +---- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/primitives/block.h b/src/primitives/block.h index dda9a9d609..4ec1cf75ca 100644 --- a/src/primitives/block.h +++ b/src/primitives/block.h @@ -130,10 +130,7 @@ struct CBlockLocator CBlockLocator() {} - CBlockLocator(const std::vector& vHaveIn) - { - vHave = vHaveIn; - } + CBlockLocator(const std::vector& vHaveIn) : vHave(vHaveIn) {} ADD_SERIALIZE_METHODS; diff --git a/src/protocol.cpp b/src/protocol.cpp index 48146ee8f9..3449b54f80 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -257,11 +257,7 @@ CInv::CInv() hash.SetNull(); } -CInv::CInv(int typeIn, const uint256& hashIn) -{ - type = typeIn; - hash = hashIn; -} +CInv::CInv(int typeIn, const uint256& hashIn) : type(typeIn), hash(hashIn) {} CInv::CInv(const std::string& strType, const uint256& hashIn) { diff --git a/src/rpc/server.h b/src/rpc/server.h index 98e2bddbe5..de3b74ead2 100644 --- a/src/rpc/server.h +++ b/src/rpc/server.h @@ -48,7 +48,7 @@ public: std::string URI; std::string authUser; - JSONRPCRequest() { id = NullUniValue; params = NullUniValue; fHelp = false; } + JSONRPCRequest() : id(NullUniValue), params(NullUniValue), fHelp(false) {} void parse(const UniValue& valRequest); }; diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 0dc655672a..7eb94c2cdc 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -159,10 +159,7 @@ public: std::string name; std::string purpose; - CAddressBookData() - { - purpose = "unknown"; - } + CAddressBookData() : purpose("unknown") {} typedef std::map StringMap; StringMap destdata;