Ensure curly-braces around control-flow
[folly.git] / folly / io / IOBufQueue.h
index be334d38a475812856f96c73e59c2fee77966ba2..c801920d34f793cd9e60608af254207652657564 100644 (file)
@@ -213,12 +213,24 @@ class IOBufQueue {
    */
   void trimStart(size_t amount);
 
+  /**
+   * Similar to trimStart, but will trim at most amount bytes and returns
+   * the number of bytes trimmed.
+   */
+  size_t trimStartAtMost(size_t amount);
+
   /**
    * Similar to IOBuf::trimEnd, but works on the whole queue.  Will
    * pop off buffers that have been completely trimmed.
    */
   void trimEnd(size_t amount);
 
+  /**
+   * Similar to trimEnd, but will trim at most amount bytes and returns
+   * the number of bytes trimmed.
+   */
+  size_t trimEndAtMost(size_t amount);
+
   /**
    * Transfer ownership of the queue's entire IOBuf chain to the caller.
    */
@@ -286,7 +298,9 @@ class IOBufQueue {
 
  private:
   IOBuf* tailBuf() const {
-    if (UNLIKELY(!head_)) return nullptr;
+    if (UNLIKELY(!head_)) {
+      return nullptr;
+    }
     IOBuf* buf = head_->prev();
     return LIKELY(!buf->isSharedOne()) ? buf : nullptr;
   }
@@ -310,4 +324,4 @@ class IOBufQueue {
   std::unique_ptr<folly::IOBuf> head_;
 };
 
-} // folly
+} // namespace folly