Browse Source

etcdserver: fix from go vet, go lint

Gyu-Ho Lee 9 years ago
parent
commit
725ded40f7
1 changed files with 1 additions and 2 deletions
  1. 1 2
      etcdserver/apply_v2.go

+ 1 - 2
etcdserver/apply_v2.go

@@ -65,9 +65,8 @@ func (a *applierV2store) Put(r *pb.Request) Response {
 		if exists {
 			if r.PrevIndex == 0 && r.PrevValue == "" {
 				return toResponse(a.store.Update(r.Path, r.Val, ttlOptions))
-			} else {
-				return toResponse(a.store.CompareAndSwap(r.Path, r.PrevValue, r.PrevIndex, r.Val, ttlOptions))
 			}
+			return toResponse(a.store.CompareAndSwap(r.Path, r.PrevValue, r.PrevIndex, r.Val, ttlOptions))
 		}
 		return toResponse(a.store.Create(r.Path, r.Dir, r.Val, false, ttlOptions))
 	case r.PrevIndex > 0 || r.PrevValue != "":