func NewPersistentState(term int, lastVotedServerID int, ents []*LogEntry) *PersistentState {
	logs := &LogRepo{logs: map[int]*LogEntry{}, lastIndex: 0}
	for _, ent := range ents {
		logs.SaveLogEntry(ent)
	}
	return &PersistentState{Term: term, LastVotedServerID: lastVotedServerID, Logs: logs}
}
// NewPersistentState return a new PersistentState
NewPersistentState return a new PersistentState
// NewPersistentState return a new PersistentState
func NewPersistentState(term int, lastVotedServerID int, ents []*LogEntry) *PersistentState {
	logs := &LogRepo{logs: map[int]*LogEntry{}, lastIndex: 0}
	for _, ent := range ents {
		logs.SaveLogEntry(ent)
	}
	return &PersistentState{Term: term, LastVotedServerID: lastVotedServerID, Logs: logs}
}
func NewPersistentState ( term int , lastVotedServerID int , ents [ ] * LogEntry ) * PersistentState { logs := & LogRepo { logs : map [ int ] * LogEntry { } , lastIndex : 0 } for _ , ent := range ents { logs . SaveLogEntry ( ent ) } return & PersistentState { Term : term , LastVotedServerID : lastVotedServerID , Logs : logs } }
NewPersistentState return a new PersistentState
NewPersistentState return a new PersistentState