+ const IOBuf* crtBuf = crtBuf_;
+ auto crtPos = crtPos_;
+ // We can be pointing to the end of a buffer chunk, find first non-empty.
+ while (crtPos == crtBuf->tail() && crtBuf != buffer_->prev()) {
+ crtBuf = crtBuf->next();
+ crtPos = crtBuf->data();
+ }
+
+ const IOBuf* crtBufOther = other.crtBuf_;
+ auto crtPosOther = other.crtPos_;
+ // We can be pointing to the end of a buffer chunk, find first non-empty.
+ while (crtPosOther == crtBufOther->tail() &&
+ crtBufOther != other.buffer_->prev()) {
+ crtBufOther = crtBufOther->next();
+ crtPosOther = crtBufOther->data();
+ }
+ return (crtPos == crtPosOther) && (crtBuf == crtBufOther);