mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: remove redundant parentheses.
This commit is contained in:
parent
f0aeb705ce
commit
802e2aaadd
@ -79,7 +79,7 @@ func (eh *EventHistory) scan(key string, recursive bool, index uint64) (*Event,
|
|||||||
e := eh.Queue.Events[i]
|
e := eh.Queue.Events[i]
|
||||||
|
|
||||||
if !e.Refresh {
|
if !e.Refresh {
|
||||||
ok := (e.Node.Key == key)
|
ok := e.Node.Key == key
|
||||||
|
|
||||||
if recursive {
|
if recursive {
|
||||||
// add tailing slash
|
// add tailing slash
|
||||||
|
@ -338,8 +338,8 @@ func (n *node) UpdateTTL(expireTime time.Time) {
|
|||||||
// Compare function compares node index and value with provided ones.
|
// Compare function compares node index and value with provided ones.
|
||||||
// second result value explains result and equals to one of Compare.. constants
|
// second result value explains result and equals to one of Compare.. constants
|
||||||
func (n *node) Compare(prevValue string, prevIndex uint64) (ok bool, which int) {
|
func (n *node) Compare(prevValue string, prevIndex uint64) (ok bool, which int) {
|
||||||
indexMatch := (prevIndex == 0 || n.ModifiedIndex == prevIndex)
|
indexMatch := prevIndex == 0 || n.ModifiedIndex == prevIndex
|
||||||
valueMatch := (prevValue == "" || n.Value == prevValue)
|
valueMatch := prevValue == "" || n.Value == prevValue
|
||||||
ok = valueMatch && indexMatch
|
ok = valueMatch && indexMatch
|
||||||
switch {
|
switch {
|
||||||
case valueMatch && indexMatch:
|
case valueMatch && indexMatch:
|
||||||
|
@ -151,7 +151,7 @@ func (wh *watcherHub) notifyWatchers(e *Event, nodePath string, deleted bool) {
|
|||||||
|
|
||||||
w, _ := curr.Value.(*watcher)
|
w, _ := curr.Value.(*watcher)
|
||||||
|
|
||||||
originalPath := (e.Node.Key == nodePath)
|
originalPath := e.Node.Key == nodePath
|
||||||
if (originalPath || !isHidden(nodePath, e.Node.Key)) && w.notify(e, originalPath, deleted) {
|
if (originalPath || !isHidden(nodePath, e.Node.Key)) && w.notify(e, originalPath, deleted) {
|
||||||
if !w.stream { // do not remove the stream watcher
|
if !w.stream { // do not remove the stream watcher
|
||||||
// if we successfully notify a watcher
|
// if we successfully notify a watcher
|
||||||
|
@ -531,8 +531,8 @@ func compareFail(nodePath, prevValue string, prevIndex uint64, resp *clientv3.Tx
|
|||||||
return v2error.NewError(v2error.EcodeKeyNotFound, nodePath, mkV2Rev(resp.Header.Revision))
|
return v2error.NewError(v2error.EcodeKeyNotFound, nodePath, mkV2Rev(resp.Header.Revision))
|
||||||
}
|
}
|
||||||
kv := kvs[0]
|
kv := kvs[0]
|
||||||
indexMatch := (prevIndex == 0 || kv.ModRevision == int64(prevIndex))
|
indexMatch := prevIndex == 0 || kv.ModRevision == int64(prevIndex)
|
||||||
valueMatch := (prevValue == "" || string(kv.Value) == prevValue)
|
valueMatch := prevValue == "" || string(kv.Value) == prevValue
|
||||||
var cause string
|
var cause string
|
||||||
switch {
|
switch {
|
||||||
case indexMatch && !valueMatch:
|
case indexMatch && !valueMatch:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user