diff --git a/raft/fsm.hh b/raft/fsm.hh index 964e1a6765..24e52589c7 100644 --- a/raft/fsm.hh +++ b/raft/fsm.hh @@ -46,14 +46,6 @@ struct fsm_output { bool state_changed = false; // Set to true if a leadership transfer was aborted since the last output bool abort_leadership_transfer; - - // True if there is no new output - bool empty() const { - return !term_and_vote && - log_entries.size() == 0 && messages.size() == 0 && - committed.size() == 0 && !snp && snps_to_drop.empty() && - !configuration && !max_read_id_with_quorum; - } }; struct fsm_config { diff --git a/test/raft/helpers.cc b/test/raft/helpers.cc index 551879b198..06a68ee6db 100644 --- a/test/raft/helpers.cc +++ b/test/raft/helpers.cc @@ -94,7 +94,8 @@ communicate_impl(std::function stop_pred, raft_routing_map& map) { has_traffic = false; for (auto e : map) { raft::fsm& from = *e.second; - for (auto output = from.get_output(); !output.empty(); output = from.get_output()) { + for (bool has_output = from.has_output(); has_output; has_output = from.has_output()) { + auto output = from.get_output(); if (stop_pred()) { return; }