Update src/io/rsm/raft.hpp

Co-authored-by: János Benjamin Antal <antaljanosbenjamin@users.noreply.github.com>
This commit is contained in:
Tyler Neely 2022-08-16 17:13:03 +02:00 committed by GitHub
parent 2e9cf8f37d
commit c256dce601
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -372,15 +372,16 @@ class Raft {
LogIndex LastLogIndex() { return state_.log.size(); }
Term LastLogTerm() {
Term LastLogTerm() const {
if (state_.log.empty()) {
return 0;
}
auto &[term, data] = state_.log.back();
const auto &[term, data] = state_.log.back();
return term;
}
template <typename... Ts>
void Log(Ts &&...args) {
const Time now = io_.Now();