Remove every entry but keep the allocated capacity, so that refilling
the map does not have to reallocate. A cleared map iterates as empty
and the next insert starts a fresh insertion order at position 1.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(hash_map_t), | intent(inout) | :: | this |
subroutine hash_map_clear(this) !! Remove every entry but keep the allocated capacity, so that refilling !! the map does not have to reallocate. A cleared map iterates as empty !! and the next `insert` starts a fresh insertion order at position 1. class(hash_map_t), intent(inout) :: this this%n_entries = 0 this%pool_used = 0 if (allocated(this%buckets)) this%buckets = BUCKET_EMPTY end subroutine hash_map_clear