You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/04/14 18:26:22 UTC

[GitHub] [beam] thetorpedodog commented on a change in pull request #11413: [BEAM-9746] check for 0 length copies from state

thetorpedodog commented on a change in pull request #11413: [BEAM-9746] check for 0 length copies from state
URL: https://github.com/apache/beam/pull/11413#discussion_r408284011
 
 

 ##########
 File path: sdks/go/pkg/beam/core/runtime/harness/datamgr.go
 ##########
 @@ -369,11 +371,14 @@ func (r *dataReader) Read(buf []byte) (int, error) {
 		r.cur = b
 	}
 
+	// We don't need to check for a 0 length copy from r.cur here, since that's
+	// checked before buffers are handed to the r.buf channel.
 	n := copy(buf, r.cur)
 
-	if len(r.cur) == n {
+	switch {
 
 Review comment:
   seems like this could still be an if-else?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services