Browse Source

codec: rpc: remove comments

Ugorji Nwoke 7 years ago
parent
commit
e60e086af5
1 changed files with 1 additions and 10 deletions
  1. 1 10
      codec/rpc.go

+ 1 - 10
codec/rpc.go

@@ -104,7 +104,7 @@ func (c *rpcCodec) write(obj1, obj2 interface{}, writeObj2 bool) (err error) {
 		if err == nil {
 			err = c.f.Flush()
 		} else {
-			c.f.Flush()
+			_ = c.f.Flush() // swallow flush error, so we maintain prior error on write
 		}
 	}
 	return
@@ -144,15 +144,6 @@ func (c *rpcCodec) Close() error {
 	}
 	c.clsmu.Lock()
 	c.cls = true
-	// var fErr error
-	// if c.f != nil {
-	// 	fErr = c.f.Flush()
-	// }
-	// _ = fErr
-	// c.clsErr = c.c.Close()
-	// if c.clsErr == nil && fErr != nil {
-	// 	c.clsErr = fErr
-	// }
 	c.clsErr = c.c.Close()
 	c.clsmu.Unlock()
 	return c.clsErr