folly::Unit::Drop.
[folly.git] / folly / GroupVarint.h
index 0bdf36975018fcf7351dd81f7746f91aa2ff4ddb..f50617cb7c7003f2b3b666bf878c473a7cbaf560 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2015 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -176,7 +176,7 @@ class GroupVarint<uint32_t> : public detail::GroupVarintBase<uint32_t> {
     p += k2+1;
     size_t k3 = b3key(k);
     *d = loadUnaligned<uint32_t>(p) & kMask[k3];
-    p += k3+1;
+    // p += k3+1;
     return end;
   }
 
@@ -189,6 +189,10 @@ class GroupVarint<uint32_t> : public detail::GroupVarintBase<uint32_t> {
   }
 
 #ifdef __SSSE3__
+  /**
+   * Just like the non-SSSE3 decode below, but with the additional constraint
+   * that we must be able to read at least 17 bytes from the input pointer, p.
+   */
   static const char* decode(const char* p, uint32_t* dest) {
     uint8_t key = p[0];
     __m128i val = _mm_loadu_si128((const __m128i*)(p+1));
@@ -198,6 +202,10 @@ class GroupVarint<uint32_t> : public detail::GroupVarintBase<uint32_t> {
     return p + detail::groupVarintLengths[key];
   }
 
+  /**
+   * Just like decode_simple, but with the additional constraint that
+   * we must be able to read at least 17 bytes from the input pointer, p.
+   */
   static const char* decode(const char* p, uint32_t* a, uint32_t* b,
                             uint32_t* c, uint32_t* d) {
     uint8_t key = p[0];
@@ -504,7 +512,7 @@ class GroupVarintDecoder {
   typedef GroupVarint<T> Base;
   typedef T type;
 
-  GroupVarintDecoder() { }
+  GroupVarintDecoder() = default;
 
   explicit GroupVarintDecoder(StringPiece data,
                               size_t maxCount = (size_t)-1)