Don't return a nullptr from IOBufQueue::split(0)
authorOtto Ebeling <otto@fb.com>
Thu, 27 Apr 2017 15:49:50 +0000 (08:49 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 27 Apr 2017 15:51:53 +0000 (08:51 -0700)
commitaf5ed37b6f4898842d55e7db80e74ba845d00393
tree438ef0313b2e00029058e25eb81a68396b21f51a
parentb73507bb0f91c1593705f4ff0746c1ff93ed5762
Don't return a nullptr from IOBufQueue::split(0)

Summary: There's a gotcha case for IOBufQueue::split when  n==0, it will then return an unique_ptr wrapping a nullptr, which many call sites do not expect.

Reviewed By: meyering

Differential Revision: D4868228

fbshipit-source-id: 418256dba8ca3bcfbae420b6099baa240055b9bb
folly/io/IOBufQueue.cpp
folly/io/test/IOBufQueueTest.cpp