Skip to content

Commit

Permalink
Fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SpyCheese committed Nov 29, 2024
1 parent 0280a28 commit ea73a3b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions tdutils/td/utils/Timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "td/utils/Time.h"

#include <numeric>
#include <algorithm>

namespace td {

Expand Down
6 changes: 3 additions & 3 deletions validator-engine/validator-engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ td::Result<bool> Config::config_add_collator(ton::adnl::AdnlNodeIdShort addr, to
return td::Status::Error(PSTRING() << "invalid shard: " << shard.to_str());
}
auto& shards = collators[addr];
if (std::ranges::find(shards, shard) != collators[addr].end()) {
if (std::find(shards.begin(), shards.end(), shard) != shards.end()) {
return false;
}
shards.push_back(shard);
Expand All @@ -484,7 +484,7 @@ td::Result<bool> Config::config_del_collator(ton::adnl::AdnlNodeIdShort addr, to
return td::Status::Error(PSTRING() << "invalid shard: " << shard.to_str());
}
auto& shards = collators[addr];
auto it = std::ranges::find(shards, shard);
auto it = std::find(shards.begin(), shards.end(), shard);
if (it == shards.end()) {
return false;
}
Expand Down Expand Up @@ -1605,7 +1605,7 @@ void ValidatorEngine::set_shard_check_function() {
shards.push_back(s);
}
std::sort(shards.begin(), shards.end());
shards.erase(std::ranges::unique(shards).begin(), shards.end());
shards.erase(std::unique(shards.begin(), shards.end()), shards.end());
validator_options_.write().set_shard_check_function(
[shards = std::move(shards)](ton::ShardIdFull shard) -> bool {
for (auto s : shards) {
Expand Down
8 changes: 4 additions & 4 deletions validator/collator-node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ void CollatorNode::tear_down() {

void CollatorNode::add_shard(ShardIdFull shard) {
CHECK(shard.is_valid_ext() && !shard.is_masterchain());
if (std::ranges::find(collating_shards_, shard) != collating_shards_.end()) {
if (std::find(collating_shards_.begin(), collating_shards_.end(), shard) != collating_shards_.end()) {
return;
}
LOG(INFO) << "Collator node: local_id=" << local_id_ << " , shard=" << shard.to_str();
collating_shards_.push_back(shard);
}

void CollatorNode::del_shard(ShardIdFull shard) {
auto it = std::ranges::find(collating_shards_, shard);
auto it = std::find(collating_shards_.begin(), collating_shards_.end(), shard);
if (it != collating_shards_.end()) {
collating_shards_.erase(it);
}
Expand Down Expand Up @@ -608,8 +608,8 @@ void CollatorNode::process_ping(adnl::AdnlNodeIdShort src, ton_api::collatorNode
}

bool CollatorNode::can_collate_shard(ShardIdFull shard) const {
return std::ranges::any_of(collating_shards_,
[&](const ShardIdFull& our_shard) { return shard_intersects(shard, our_shard); });
return std::any_of(collating_shards_.begin(), collating_shards_.end(),
[&](const ShardIdFull& our_shard) { return shard_intersects(shard, our_shard); });
}

tl_object_ptr<ton_api::collatorNode_Candidate> CollatorNode::serialize_candidate(const BlockCandidate& block,
Expand Down
6 changes: 3 additions & 3 deletions validator/full-node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -936,9 +936,9 @@ bool FullNodeConfig::operator!=(const FullNodeConfig &rhs) const {
}

bool CustomOverlayParams::send_shard(const ShardIdFull &shard) const {
return sender_shards_.empty() || std::ranges::any_of(sender_shards_, [&](const ShardIdFull &our_shard) {
return shard_intersects(shard, our_shard);
});
return sender_shards_.empty() ||
std::any_of(sender_shards_.begin(), sender_shards_.end(),
[&](const ShardIdFull &our_shard) { return shard_intersects(shard, our_shard); });
}

CustomOverlayParams CustomOverlayParams::fetch(const ton_api::engine_validator_customOverlay& f) {
Expand Down

0 comments on commit ea73a3b

Please sign in to comment.