etcd-io / raft

Raft library for maintaining a replicated state machine
Apache License 2.0
666 stars 164 forks source link

raft: clean-up maybeSendAppend area #136

Closed pav-kv closed 9 months ago

pav-kv commented 9 months ago

This PR does a mechanical refactoring of raft.maybeSendAppend method. A new maybeSendSnapshot method is factored out for readability, and a couple of error conditions are optimized out. See individual commits.

These are preparatory clean-ups for #130.

pav-kv commented 9 months ago

@ahrtr PTAL. This is a mechanical change, should be easy to review. See individual commits.

ahrtr commented 9 months ago

Please resolve all review comments (or just mark it as resolved if you want to keep it as it's for now) before I merge this PR. thx

pav-kv commented 9 months ago

@ahrtr Done. Can be merged, thank you.