Compare commits

...

4 Commits

Author SHA1 Message Date
Mayukha Vadari
ddbe7db5cf fix HashRouter 2026-07-28 11:04:57 -04:00
Mayukha Vadari
eb2017c395 apply ctidy diff 2026-07-27 17:43:46 -04:00
Mayukha Vadari
de0f8b5962 Merge branch 'develop' into mvadari/ctidy-07-26 2026-07-27 17:35:02 -04:00
Mayukha Vadari
d3c89fe00e fix: Assorted clang-tidy fixes 2026-07-27 17:33:31 -04:00
8 changed files with 31 additions and 30 deletions

View File

@@ -126,7 +126,7 @@ private:
{
}
value_type value;
value_type value{};
time_point when;
};
@@ -466,8 +466,8 @@ private:
{
// Need two vectors otherwise we
// will destroy non-empty buckets.
vec_type vec(vec_.get_allocator());
std::swap(vec_, vec);
vec_type tmp(vec_.get_allocator());
std::swap(tmp, vec_);
vec_.resize(count);
c.rehash(bucket_traits(&vec_[0], vec_.size()));
return;
@@ -498,7 +498,7 @@ private:
private:
float maxLoadFactor_;
vec_type vec_;
vec_type vec_{};
};
template <class... Args>
@@ -1455,7 +1455,7 @@ private:
private:
ConfigT config_;
Buckets buck_;
cont_type mutable cont_;
cont_type mutable cont_{};
};
//------------------------------------------------------------------------------

View File

@@ -206,8 +206,8 @@ class ListIterator
{
using iter_type = boost::string_ref::const_iterator;
iter_type it_;
iter_type end_;
iter_type it_{};
iter_type end_{};
boost::string_ref value_;
public:

View File

@@ -14,6 +14,7 @@
namespace xrpl {
namespace detail {
template <typename T>
constexpr bool kIsIntegralConstant = false;
template <typename I, auto A>

View File

@@ -75,8 +75,8 @@ protected:
boost::asio::streambuf readBuf_;
http_request_type message_;
std::vector<Buffer> wq_;
std::vector<Buffer> wq2_;
std::vector<Buffer> wq_{};
std::vector<Buffer> wq2_{};
std::mutex mutex_;
bool graceful_ = false;
bool complete_ = false;

View File

@@ -85,7 +85,7 @@ private:
std::mutex m_;
std::vector<Port> ports_;
std::vector<std::weak_ptr<Door<Handler>>> list_;
std::vector<std::weak_ptr<Door<Handler>>> list_{};
int high_ = 0;
std::array<std::size_t, 64> hist_{};

View File

@@ -49,13 +49,13 @@ public:
/**
* Verify the signing hash of the proposal
*/
bool
[[nodiscard]] bool
checkSign() const;
/**
* Signature of the proposal (not necessarily verified)
*/
Slice
[[nodiscard]] Slice
signature() const
{
return {signature_.data(), signature_.size()};
@@ -64,7 +64,7 @@ public:
/**
* Public key of peer that sent the proposal
*/
PublicKey const&
[[nodiscard]] PublicKey const&
publicKey() const
{
return publicKey_;
@@ -73,13 +73,13 @@ public:
/**
* Unique id used by hash router to suppress duplicates
*/
uint256 const&
[[nodiscard]] uint256 const&
suppressionID() const
{
return suppression_;
}
Proposal const&
[[nodiscard]] Proposal const&
proposal() const
{
return proposal_;
@@ -88,10 +88,10 @@ public:
/**
* JSON representation of proposal
*/
json::Value
[[nodiscard]] json::Value
getJson() const;
std::string
[[nodiscard]] std::string
render() const
{
return proposal_.render();

View File

@@ -875,7 +875,7 @@ private:
SLastEntry // Any new entry must be ADDED ABOVE this one
};
std::array<SubMapType, SubTypes::SLastEntry> streamMaps_;
std::array<SubMapType, SubTypes::SLastEntry> streamMaps_{};
ServerFeeSummary lastFeeSummary_;

View File

@@ -75,25 +75,25 @@ public:
return transaction_;
}
uint256 const&
[[nodiscard]] uint256 const&
getID() const
{
return transactionID_;
}
LedgerIndex
[[nodiscard]] LedgerIndex
getLedger() const
{
return ledgerIndex_;
}
bool
[[nodiscard]] bool
isValidated() const
{
return ledgerIndex_ != 0;
}
TransStatus
[[nodiscard]] TransStatus
getStatus() const
{
return status_;
@@ -146,7 +146,7 @@ public:
*
* @return Whether transaction is being applied within a batch.
*/
bool
[[nodiscard]] bool
getApplying() const
{
// Note that all access to applying_ are made by NetworkOPsImp, and must
@@ -199,7 +199,7 @@ public:
* @brief getSubmitResult Return submit result
* @return SubmitResult struct
*/
SubmitResult
[[nodiscard]] SubmitResult
getSubmitResult() const
{
return submitResult_;
@@ -276,7 +276,7 @@ public:
* @brief getCurrentLedgerState Get current ledger state of transaction
* @return Current ledger state
*/
std::optional<CurrentLedgerState>
[[nodiscard]] std::optional<CurrentLedgerState>
getCurrentLedgerState() const
{
return currentLedgerState_;
@@ -299,7 +299,7 @@ public:
currentLedgerState_.emplace(validatedLedger, fee, accountSeq, availableSeq);
}
json::Value
[[nodiscard]] json::Value
getJson(JsonOptions options, bool binary = false) const;
// Information used to locate a transaction.
@@ -328,8 +328,8 @@ public:
*
* @throws if isFound() returns false
*/
uint256 const&
getNodestoreHash()
[[nodiscard]] uint256 const&
getNodestoreHash() const
{
return std::get<std::pair<uint256, uint32_t>>(locator).first;
}
@@ -339,8 +339,8 @@ public:
*
* @throws if isFound() returns false
*/
uint32_t
getLedgerSequence()
[[nodiscard]] uint32_t
getLedgerSequence() const
{
return std::get<std::pair<uint256, uint32_t>>(locator).second;
}