Definition at line 174 of file dc_hash.f90.
◆ dchashdelete0()
subroutine dc_hash::delete::dchashdelete0 |
( |
type(hash), intent(inout) |
hashv, |
|
|
character(*), intent(in), optional |
key |
|
) |
| |
|
private |
Definition at line 362 of file dc_hash.f90.
370 type(
hash),
intent(inout) :: hashv
371 character(*),
intent(in),
optional :: key
373 integer :: table_size, i, j
375 character(STRING) :: search_value
377 if (
present(key))
then 378 call dchashget(hashv, key, search_value, found)
380 if (found .and. table_size > 1)
then 381 allocate(hash_table_tmp(table_size))
382 hash_table_tmp = hashv % hash_table
383 deallocate(hashv % hash_table)
384 allocate(hashv % hash_table(table_size - 1))
387 if (trim(hash_table_tmp(i) % key) /= trim(key))
then 388 hashv % hash_table(j) % key = hash_table_tmp(i) % key
389 hashv % hash_table(j) % value = hash_table_tmp(i) % value
394 deallocate(hash_table_tmp)
395 elseif (found .and. table_size == 1)
then 396 deallocate(hashv % hash_table)
399 if (
associated(hashv % hash_table))
deallocate(hashv % hash_table)
The documentation for this interface was generated from the following file: