Skip to content

Commit be3e042

Browse files
committed
Merge #10523: Perform member initialization in initialization lists where possible
656dbd8 Perform member initialization in initialization lists where possible (practicalswift) Tree-SHA512: 048380f4da23ab1eaaf471801a01dbd76f2235afb686c1489b30a6bac109195134afc83414b8378d3482a9042d537ec62d30136dadb9347cf06b07fb5c693208
2 parents 75e898c + 656dbd8 commit be3e042

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

src/primitives/block.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,7 @@ struct CBlockLocator
129129

130130
CBlockLocator() {}
131131

132-
CBlockLocator(const std::vector<uint256>& vHaveIn)
133-
{
134-
vHave = vHaveIn;
135-
}
132+
CBlockLocator(const std::vector<uint256>& vHaveIn) : vHave(vHaveIn) {}
136133

137134
ADD_SERIALIZE_METHODS;
138135

src/protocol.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,7 @@ CInv::CInv()
151151
hash.SetNull();
152152
}
153153

154-
CInv::CInv(int typeIn, const uint256& hashIn)
155-
{
156-
type = typeIn;
157-
hash = hashIn;
158-
}
154+
CInv::CInv(int typeIn, const uint256& hashIn) : type(typeIn), hash(hashIn) {}
159155

160156
bool operator<(const CInv& a, const CInv& b)
161157
{

src/rpc/server.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class JSONRPCRequest
5050
std::string URI;
5151
std::string authUser;
5252

53-
JSONRPCRequest() { id = NullUniValue; params = NullUniValue; fHelp = false; }
53+
JSONRPCRequest() : id(NullUniValue), params(NullUniValue), fHelp(false) {}
5454
void parse(const UniValue& valRequest);
5555
};
5656

src/wallet/wallet.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,7 @@ class CAddressBookData
136136
std::string name;
137137
std::string purpose;
138138

139-
CAddressBookData()
140-
{
141-
purpose = "unknown";
142-
}
139+
CAddressBookData() : purpose("unknown") {}
143140

144141
typedef std::map<std::string, std::string> StringMap;
145142
StringMap destdata;

0 commit comments

Comments
 (0)