Skip to content

Commit

Permalink
Second pass of clang-tidy warnings fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanel committed Jun 15, 2024
1 parent 7728734 commit 7033e0a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy-ignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
**/json.hpp

# Ignore all protobuf/gRPC generated source files
*.pb.cc
**/*.pb.cc

*/_deps/*
3 changes: 2 additions & 1 deletion src/engine/src/exchangesorchestrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,8 @@ TradeResultPerExchange ExchangesOrchestrator::smartSell(MonetaryAmount startAmou
MonetaryAmount remStartAmount = startAmount;
if (!exchangeAmountPairVector.empty()) {
// Sort exchanges from largest to lowest available amount
std::ranges::stable_sort(exchangeAmountPairVector, std::greater{}, [](const auto &p) { return p.second; });
std::ranges::stable_sort(exchangeAmountPairVector, std::greater{},
[](const auto &exchangeAmount) { return exchangeAmount.second; });

ExchangeRetriever::PublicExchangesVec publicExchanges =
SelectUniquePublicExchanges(_exchangeRetriever, exchangeAmountPairVector, false); // unsorted
Expand Down
6 changes: 3 additions & 3 deletions src/engine/test/exchangesorchestrator_private_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,16 @@ TEST_F(ExchangeOrchestratorTest, WithdrawImpossibleTo) {
EXPECT_FALSE(deliveredWithdrawInfo.hasBeenInitiated());
}

inline bool operator==(const DeliveredWithdrawInfo &lhs, const DeliveredWithdrawInfo &rhs) {
static inline bool operator==(const DeliveredWithdrawInfo &lhs, const DeliveredWithdrawInfo &rhs) {
return lhs.withdrawId() == rhs.withdrawId();
}

namespace api {
inline bool operator==(const InitiatedWithdrawInfo &lhs, const InitiatedWithdrawInfo &rhs) {
static inline bool operator==(const InitiatedWithdrawInfo &lhs, const InitiatedWithdrawInfo &rhs) {
return lhs.withdrawId() == rhs.withdrawId();
}

inline bool operator==(const SentWithdrawInfo &lhs, const SentWithdrawInfo &rhs) {
static inline bool operator==(const SentWithdrawInfo &lhs, const SentWithdrawInfo &rhs) {
return lhs.withdrawStatus() == rhs.withdrawStatus() && lhs.netEmittedAmount() == rhs.netEmittedAmount();
}
} // namespace api
Expand Down
3 changes: 2 additions & 1 deletion src/objects/test/marketorderbook_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ MarketOrderBookLines CreateMarketOrderBookLines(std::initializer_list<OrderBookL

return marketOrderBookLines;
}

} // namespace

constexpr bool operator==(const AmountPrice &lhs, const AmountPrice &rhs) {
static constexpr bool operator==(const AmountPrice &lhs, const AmountPrice &rhs) {
return lhs.amount == rhs.amount && lhs.price == rhs.price;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ MarketOrderBookLines CreateMarketOrderBookLines(std::initializer_list<OrderBookL
return marketOrderBookLines;
}

constexpr bool operator==(const AmountPrice &lhs, const AmountPrice &rhs) {
return lhs.amount == rhs.amount && lhs.price == rhs.price;
}
} // namespace

class ProtoMarketOrderBookTest : public ::testing::Test {
Expand Down

0 comments on commit 7033e0a

Please sign in to comment.