refactor(store/event_history): cleanup some comments

release-0.4
Brandon Philips 2013-12-22 15:41:44 -08:00
parent 0937b4d266
commit 317b34f4a0
1 changed files with 4 additions and 4 deletions

View File

@ -39,13 +39,13 @@ func (eh *EventHistory) addEvent(e *Event) *Event {
return e return e
} }
// scan function is enumerating events from the index in history and // scan enumerates events from the index history and stops at the first point
// stops till the first point where the key has identified key // where the key matches.
func (eh *EventHistory) scan(key string, recursive bool, index uint64) (*Event, *etcdErr.Error) { func (eh *EventHistory) scan(key string, recursive bool, index uint64) (*Event, *etcdErr.Error) {
eh.rwl.RLock() eh.rwl.RLock()
defer eh.rwl.RUnlock() defer eh.rwl.RUnlock()
// the index should locate after the event history's StartIndex // index should be after the event history's StartIndex
if index < eh.StartIndex { if index < eh.StartIndex {
return nil, return nil,
etcdErr.NewError(etcdErr.EcodeEventIndexCleared, etcdErr.NewError(etcdErr.EcodeEventIndexCleared,
@ -53,7 +53,7 @@ func (eh *EventHistory) scan(key string, recursive bool, index uint64) (*Event,
eh.StartIndex, index), 0) eh.StartIndex, index), 0)
} }
// the index should locate before the size of the queue minus the duplicate count // the index should come before the size of the queue minus the duplicate count
if index > eh.LastIndex { // future index if index > eh.LastIndex { // future index
return nil, nil return nil, nil
} }