Compare 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

No files matched your search

@@ -126,7 +126,7 @@ private:
{ {
} }
value_type value; value_type value{};
time_point when; time_point when;
}; };
@@ -466,8 +466,8 @@ private:
{ {
// Need two vectors otherwise we // Need two vectors otherwise we
// will destroy non-empty buckets. // will destroy non-empty buckets.
vec_type vec(vec_.get_allocator()); vec_type tmp(vec_.get_allocator());
std::swap(vec_, vec); std::swap(tmp, vec_);
vec_.resize(count); vec_.resize(count);
c.rehash(bucket_traits(&vec_[0], vec_.size())); c.rehash(bucket_traits(&vec_[0], vec_.size()));
return; return;
@@ -498,7 +498,7 @@ private:
private: private:
float maxLoadFactor_; float maxLoadFactor_;
vec_type vec_; vec_type vec_{};
}; };
template <class... Args> template <class... Args>
@@ -1455,7 +1455,7 @@ private:
private: private:
ConfigT config_; ConfigT config_;
Buckets buck_; Buckets buck_;
cont_type mutable cont_; cont_type mutable cont_{};
}; };
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
+2 -2
View File
@@ -206,8 +206,8 @@ class ListIterator
{ {
using iter_type = boost::string_ref::const_iterator; using iter_type = boost::string_ref::const_iterator;
iter_type it_; iter_type it_{};
iter_type end_; iter_type end_{};
boost::string_ref value_; boost::string_ref value_;
public: public:
+1
View File
@@ -14,6 +14,7 @@
namespace xrpl { namespace xrpl {
namespace detail { namespace detail {
template <typename T> template <typename T>
constexpr bool kIsIntegralConstant = false; constexpr bool kIsIntegralConstant = false;
template <typename I, auto A> template <typename I, auto A>
+2 -2
View File
@@ -75,8 +75,8 @@ protected:
boost::asio::streambuf readBuf_; boost::asio::streambuf readBuf_;
http_request_type message_; http_request_type message_;
std::vector<Buffer> wq_; std::vector<Buffer> wq_{};
std::vector<Buffer> wq2_; std::vector<Buffer> wq2_{};
std::mutex mutex_; std::mutex mutex_;
bool graceful_ = false; bool graceful_ = false;
bool complete_ = false; bool complete_ = false;
+1 -1
View File
@@ -85,7 +85,7 @@ private:
std::mutex m_; std::mutex m_;
std::vector<Port> ports_; std::vector<Port> ports_;
std::vector<std::weak_ptr<Door<Handler>>> list_; std::vector<std::weak_ptr<Door<Handler>>> list_{};
int high_ = 0; int high_ = 0;
std::array<std::size_t, 64> hist_{}; std::array<std::size_t, 64> hist_{};
+7 -7
View File
@@ -49,13 +49,13 @@ public:
/** /**
* Verify the signing hash of the proposal * Verify the signing hash of the proposal
*/ */
bool [[nodiscard]] bool
checkSign() const; checkSign() const;
/** /**
* Signature of the proposal (not necessarily verified) * Signature of the proposal (not necessarily verified)
*/ */
Slice [[nodiscard]] Slice
signature() const signature() const
{ {
return {signature_.data(), signature_.size()}; return {signature_.data(), signature_.size()};
@@ -64,7 +64,7 @@ public:
/** /**
* Public key of peer that sent the proposal * Public key of peer that sent the proposal
*/ */
PublicKey const& [[nodiscard]] PublicKey const&
publicKey() const publicKey() const
{ {
return publicKey_; return publicKey_;
@@ -73,13 +73,13 @@ public:
/** /**
* Unique id used by hash router to suppress duplicates * Unique id used by hash router to suppress duplicates
*/ */
uint256 const& [[nodiscard]] uint256 const&
suppressionID() const suppressionID() const
{ {
return suppression_; return suppression_;
} }
Proposal const& [[nodiscard]] Proposal const&
proposal() const proposal() const
{ {
return proposal_; return proposal_;
@@ -88,10 +88,10 @@ public:
/** /**
* JSON representation of proposal * JSON representation of proposal
*/ */
json::Value [[nodiscard]] json::Value
getJson() const; getJson() const;
std::string [[nodiscard]] std::string
render() const render() const
{ {
return proposal_.render(); return proposal_.render();
+1 -1
View File
@@ -875,7 +875,7 @@ private:
SLastEntry // Any new entry must be ADDED ABOVE this one SLastEntry // Any new entry must be ADDED ABOVE this one
}; };
std::array<SubMapType, SubTypes::SLastEntry> streamMaps_; std::array<SubMapType, SubTypes::SLastEntry> streamMaps_{};
ServerFeeSummary lastFeeSummary_; ServerFeeSummary lastFeeSummary_;
+12 -12
View File
@@ -75,25 +75,25 @@ public:
return transaction_; return transaction_;
} }
uint256 const& [[nodiscard]] uint256 const&
getID() const getID() const
{ {
return transactionID_; return transactionID_;
} }
LedgerIndex [[nodiscard]] LedgerIndex
getLedger() const getLedger() const
{ {
return ledgerIndex_; return ledgerIndex_;
} }
bool [[nodiscard]] bool
isValidated() const isValidated() const
{ {
return ledgerIndex_ != 0; return ledgerIndex_ != 0;
} }
TransStatus [[nodiscard]] TransStatus
getStatus() const getStatus() const
{ {
return status_; return status_;
@@ -146,7 +146,7 @@ public:
* *
* @return Whether transaction is being applied within a batch. * @return Whether transaction is being applied within a batch.
*/ */
bool [[nodiscard]] bool
getApplying() const getApplying() const
{ {
// Note that all access to applying_ are made by NetworkOPsImp, and must // Note that all access to applying_ are made by NetworkOPsImp, and must
@@ -199,7 +199,7 @@ public:
* @brief getSubmitResult Return submit result * @brief getSubmitResult Return submit result
* @return SubmitResult struct * @return SubmitResult struct
*/ */
SubmitResult [[nodiscard]] SubmitResult
getSubmitResult() const getSubmitResult() const
{ {
return submitResult_; return submitResult_;
@@ -276,7 +276,7 @@ public:
* @brief getCurrentLedgerState Get current ledger state of transaction * @brief getCurrentLedgerState Get current ledger state of transaction
* @return Current ledger state * @return Current ledger state
*/ */
std::optional<CurrentLedgerState> [[nodiscard]] std::optional<CurrentLedgerState>
getCurrentLedgerState() const getCurrentLedgerState() const
{ {
return currentLedgerState_; return currentLedgerState_;
@@ -299,7 +299,7 @@ public:
currentLedgerState_.emplace(validatedLedger, fee, accountSeq, availableSeq); currentLedgerState_.emplace(validatedLedger, fee, accountSeq, availableSeq);
} }
json::Value [[nodiscard]] json::Value
getJson(JsonOptions options, bool binary = false) const; getJson(JsonOptions options, bool binary = false) const;
// Information used to locate a transaction. // Information used to locate a transaction.
@@ -328,8 +328,8 @@ public:
* *
* @throws if isFound() returns false * @throws if isFound() returns false
*/ */
uint256 const& [[nodiscard]] uint256 const&
getNodestoreHash() getNodestoreHash() const
{ {
return std::get<std::pair<uint256, uint32_t>>(locator).first; return std::get<std::pair<uint256, uint32_t>>(locator).first;
} }
@@ -339,8 +339,8 @@ public:
* *
* @throws if isFound() returns false * @throws if isFound() returns false
*/ */
uint32_t [[nodiscard]] uint32_t
getLedgerSequence() getLedgerSequence() const
{ {
return std::get<std::pair<uint256, uint32_t>>(locator).second; return std::get<std::pair<uint256, uint32_t>>(locator).second;
} }