Browse Source

refactor store.go remove extra assignment

Xiang Li 12 years ago
parent
commit
4bf57537b5
1 changed files with 1 additions and 3 deletions
  1. 1 3
      store/store.go

+ 1 - 3
store/store.go

@@ -119,9 +119,7 @@ func (s *Store) Update(nodePath string, newValue string, expireTime time.Time, i
 		if n.IsDir() {
 		if n.IsDir() {
 			// if the node is a directory, we cannot update value
 			// if the node is a directory, we cannot update value
 			s.Stats.Inc(UpdateFail)
 			s.Stats.Inc(UpdateFail)
-
-			err := etcdErr.NewError(etcdErr.EcodeNotFile, nodePath, index, term)
-			return nil, err
+			return nil, etcdErr.NewError(etcdErr.EcodeNotFile, nodePath, index, term)
 		}
 		}
 
 
 		e.PrevValue = n.Value
 		e.PrevValue = n.Value