altman08 commented on code in PR #3686:
URL: https://github.com/apache/brpc/pull/3686#discussion_r4421155945


##########
src/butil/iobuf.h:
##########
@@ -534,6 +534,20 @@ class IOBufCutter {
     // Returns pointer to the character, nullptr on empty
     const void* fetch1();
 
+    // Peek the unconsumed part of the current reference without copying.
+    // Load the next reference if needed; return empty on exhausted input.
+    StringPiece front_block();

Review Comment:
   > It seems that IOBufCutter is not aware of blocks. Does this function need 
to be aware of blocks?
   
   I've replaced front_block() with remaining_contiguous_bytes(), which seems 
more appropriate here. It lets callers check how many bytes are contiguous at 
the current cursor without exposing the block structure, while still supporting 
the use case described above.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to