mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
refactor(store/event_history): cleanup some comments
This commit is contained in:
parent
0937b4d266
commit
317b34f4a0
@ -39,13 +39,13 @@ func (eh *EventHistory) addEvent(e *Event) *Event {
|
||||
return e
|
||||
}
|
||||
|
||||
// scan function is enumerating events from the index in history and
|
||||
// stops till the first point where the key has identified key
|
||||
// scan enumerates events from the index history and stops at the first point
|
||||
// where the key matches.
|
||||
func (eh *EventHistory) scan(key string, recursive bool, index uint64) (*Event, *etcdErr.Error) {
|
||||
eh.rwl.RLock()
|
||||
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 {
|
||||
return nil,
|
||||
etcdErr.NewError(etcdErr.EcodeEventIndexCleared,
|
||||
@ -53,7 +53,7 @@ func (eh *EventHistory) scan(key string, recursive bool, index uint64) (*Event,
|
||||
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
|
||||
return nil, nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user