remove always true if-predicate (gcc-5 -Wlogical-op)
[folly.git] / folly / Varint.h
index e4af0c19000a02697f0d5aee3ad1711ff44791fb..6cb42d1fa9d2f84308a92547fc483a255f676ca0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -87,7 +87,7 @@ inline size_t encodeVarint(uint64_t val, uint8_t* buf) {
     *p++ = 0x80 | (val & 0x7f);
     val >>= 7;
   }
-  *p++ = val;
+  *p++ = uint8_t(val);
   return p - buf;
 }
 
@@ -133,7 +133,7 @@ inline uint64_t decodeVarint(Range<T*>& data) {
     val |= static_cast<uint64_t>(*p++) << shift;
   }
 
-  data.advance(p - begin);
+  data.uncheckedAdvance(p - begin);
   return val;
 }