Remove extra FLAGS_seed definition
[folly.git] / folly / FBVector.h
index b4e253ed1dd24e024d384978dfa44aa07a953187..c773a7f963dc023b01942eba114345d1449002cf 100644 (file)
@@ -654,7 +654,7 @@ private:
   }
 
   // done
-  void relocate_done(T* dest, T* first, T* last) noexcept {
+  void relocate_done(T* /*dest*/, T* first, T* last) noexcept {
     if (folly::IsRelocatable<T>::value && usingStdAllocator::value) {
       // used memcpy; data has been relocated, do not call destructor
     } else {
@@ -966,6 +966,12 @@ public:
   }
 
   void shrink_to_fit() noexcept {
+    if (empty()) {
+      // Just skip reallocation.
+      *this = fbvector();
+      return;
+    }
+
     auto const newCapacityBytes = folly::goodMallocSize(size() * sizeof(T));
     auto const newCap = newCapacityBytes / sizeof(T);
     auto const oldCap = capacity();