pub fn with_capacity(capacity: usize) -> RawTable<T> {
        if capacity == 0 {
            RawTable::new()
        } else {
            unsafe {
                let result = RawTable::new_uninitialized(capacity_to_buckets(capacity));
                result
                    .ctrl(0)
                    .write_bytes(EMPTY, result.buckets() + Group::WIDTH);

                // If we have fewer buckets than the group width then we need to
                // fill in unused spaces in the trailing control bytes with
                // DELETED entries. See the comments in set_ctrl.
                if result.buckets() < Group::WIDTH {
                    result
                        .ctrl(result.buckets())
                        .write_bytes(DELETED, Group::WIDTH - result.buckets());
                }

                result
            }
        }
    }
/// Allocates a new hash table with at least enough capacity for inserting
/// the given number of elements without reallocating.
Allocates a new hash table with at least enough capacity for inserting
the given number of elements without reallocating.
Allocates a new hash table with at least enough capacity for inserting the given number of elements without reallocating .
pub fn with_capacity(capacity: usize) -> RawTable<T> {
        if capacity == 0 {
            RawTable::new()
        } else {
            unsafe {
                let result = RawTable::new_uninitialized(capacity_to_buckets(capacity));
                result
                    .ctrl(0)
                    .write_bytes(EMPTY, result.buckets() + Group::WIDTH);
                // If we have fewer buckets than the group width then we need to
                // fill in unused spaces in the trailing control bytes with
                // DELETED entries. See the comments in set_ctrl.
                if result.buckets() < Group::WIDTH {
                    result
                        .ctrl(result.buckets())
                        .write_bytes(DELETED, Group::WIDTH - result.buckets());
                }
                result
            }
        }
    }
pub fn with_capacity ( capacity : usize ) -> RawTable < T > { if capacity == 0 { RawTable :: new ( ) } else { unsafe { let result = RawTable :: new_uninitialized ( capacity_to_buckets ( capacity ) ) ; result . ctrl ( 0 ) . write_bytes ( EMPTY , result . buckets ( ) + Group :: WIDTH ) ; // If we have fewer buckets than the group width then we need to // fill in unused spaces in the trailing control bytes with // DELETED entries. See the comments in set_ctrl. if result . buckets ( ) < Group :: WIDTH { result . ctrl ( result . buckets ( ) ) . write_bytes ( DELETED , Group :: WIDTH - result . buckets ( ) ) ; } result } } }
Allocates a new hash table with at least enough capacity for inserting
the given number of elements without reallocating.
Allocates a new hash table with at least enough capacity for inserting the given number of elements without reallocating .
capacity
usize
capacity
usize