sink: (minor) simplify a chunk of code
@@ -1649,15 +1649,15 @@ func (batch *recBatch) tryBuffer(pr promisedRec, produceVersion, maxBatchBytes i
batchWireLength, _ := batch.wireLengthForProduceVersion(produceVersion)
newBatchLength := batchWireLength + recordNumbers.wireLength()
- if batch.tries == 0 && newBatchLength <= maxBatchBytes {
+ if batch.tries != 0 || newBatchLength > maxBatchBytes {
+ return false, false
+ }
if abortOnNewBatch {
return false, true
}
batch.appendRecord(pr, recordNumbers)
return true, false
}
- return false, false
-}
//////////////
// ENCODING // - this section is all about actually writing a produce request
