Use std::make_move_iterator for adding entries from AppendRequest into a Follower's Raft log
This commit is contained in:
parent
e67eefb1a3
commit
726c42a3fc
@ -727,7 +727,8 @@ class Raft {
|
||||
// hasn't reached consensus yet, which is normal)
|
||||
state_.log.resize(resize_length);
|
||||
|
||||
state_.log.insert(state_.log.end(), req.entries.begin(), req.entries.end());
|
||||
state_.log.insert(state_.log.end(), std::make_move_iterator(req.entries.begin()),
|
||||
std::make_move_iterator(req.entries.end()));
|
||||
|
||||
MG_ASSERT(req.leader_commit >= state_.committed_log_size);
|
||||
state_.committed_log_size = std::min(req.leader_commit, state_.log.size());
|
||||
|
Loading…
Reference in New Issue
Block a user