aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2017-06-04 01:09:48 +0200
committerpracticalswift <practicalswift@users.noreply.github.com>2017-06-04 01:09:48 +0200
commit656dbd871ae5f460c6ae4506376b059ed41fb6bc (patch)
treee37b93c406ba17745fedb54be9593f43ae9d0127 /src
parentf259263a7b11c6ff925851985ef0082b0a190a57 (diff)
Perform member initialization in initialization lists where possible
Diffstat (limited to 'src')
-rw-r--r--src/primitives/block.h5
-rw-r--r--src/protocol.cpp6
-rw-r--r--src/rpc/server.h2
-rw-r--r--src/wallet/wallet.h5
4 files changed, 4 insertions, 14 deletions
diff --git a/src/primitives/block.h b/src/primitives/block.h
index 4c6eb20ad5..f03cf48504 100644
--- a/src/primitives/block.h
+++ b/src/primitives/block.h
@@ -129,10 +129,7 @@ struct CBlockLocator
CBlockLocator() {}
- CBlockLocator(const std::vector<uint256>& vHaveIn)
- {
- vHave = vHaveIn;
- }
+ CBlockLocator(const std::vector<uint256>& vHaveIn) : vHave(vHaveIn) {}
ADD_SERIALIZE_METHODS;
diff --git a/src/protocol.cpp b/src/protocol.cpp
index 28d1d0eeb4..6cd246ed53 100644
--- a/src/protocol.cpp
+++ b/src/protocol.cpp
@@ -151,11 +151,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) {}
bool operator<(const CInv& a, const CInv& b)
{
diff --git a/src/rpc/server.h b/src/rpc/server.h
index 1e984cbc0d..a893f49033 100644
--- a/src/rpc/server.h
+++ b/src/rpc/server.h
@@ -50,7 +50,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 11b2f7a663..a8bde8359c 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -136,10 +136,7 @@ public:
std::string name;
std::string purpose;
- CAddressBookData()
- {
- purpose = "unknown";
- }
+ CAddressBookData() : purpose("unknown") {}
typedef std::map<std::string, std::string> StringMap;
StringMap destdata;