Fix InpuByteStreamSplitter in debug mode.
authorTudor Bosman <tudorb@fb.com>
Sat, 8 Sep 2012 04:46:58 +0000 (21:46 -0700)
committerJordan DeLong <jdelong@fb.com>
Mon, 17 Sep 2012 01:30:52 +0000 (18:30 -0700)
Test Plan: stream_test, exception_tracer_test

Reviewed By: soren@fb.com

FB internal diff: D569476

folly/experimental/io/Stream-inl.h

index d4a7f3f45850532bd6045b0461e6faf1f96dd092..925c19881908d7fadbaa8fb3459ada3568b56616 100644 (file)
@@ -34,7 +34,7 @@ InputByteStreamSplitter<Stream>::InputByteStreamSplitter(
 
 template <class Stream>
 bool InputByteStreamSplitter<Stream>::operator()(ByteRange& chunk) {
-  DCHECK_EQ(buffer_->length(), 0);
+  DCHECK(!buffer_ || buffer_->length() == 0);
   chunk.clear();
   if (rest_.empty()) {
     if (done_) {