wal: named return values for ReadAll.

This commit is contained in:
Xiang Li
2014-09-08 15:36:25 -07:00
parent a3b6a646eb
commit adff0f3813

View File

@@ -141,14 +141,10 @@ func OpenFromIndex(dirpath string, index int64) (*WAL, error) {
// ReadAll reads out all records of the current WAL.
// After ReadAll, the WAL will be ready for appending new records.
func (w *WAL) ReadAll() (int64, raftpb.State, []raftpb.Entry, error) {
var id int64
var state raftpb.State
var entries []raftpb.Entry
func (w *WAL) ReadAll() (id int64, state raftpb.State, entries []raftpb.Entry, err error) {
rec := &walpb.Record{}
decoder := w.decoder
var err error
for err = decoder.decode(rec); err == nil; err = decoder.decode(rec) {
switch rec.Type {
case entryType: