add config to allow using quadratic probing
[folly.git] / folly / AtomicUnorderedMap.h
index 941905efabebfd343e03caa8fa14939ecd4e65a8..4c0afb689aa30426aec8bf4f6d4b990ab8d27a28 100644 (file)
@@ -210,7 +210,7 @@ struct AtomicUnorderedInsertMap {
       const Allocator& alloc = Allocator())
     : allocator_(alloc)
   {
-    size_t capacity = maxSize / std::max(1.0f, maxLoadFactor) + 128;
+    size_t capacity = maxSize / std::min(1.0f, maxLoadFactor) + 128;
     size_t avail = size_t{1} << (8 * sizeof(IndexType) - 2);
     if (capacity > avail && maxSize < avail) {
       // we'll do our best