Skip to content

Commit 822b5c9

Browse files
committed
stdlib_hashmap_wrappers and test_maps.fypp
Added doc strings to explain the key_type approach in test_map.fypp. Indentation cleanup Added pure specifier to get and set int32 key type routines.
1 parent 9ebb0c2 commit 822b5c9

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/stdlib_hashmap_wrappers.f90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ subroutine get_int8_key( key, value )
279279
end subroutine get_int8_key
280280

281281

282-
subroutine get_int32_key( key, value )
282+
pure subroutine get_int32_key( key, value )
283283
!! Version: Experimental
284284
!!
285285
!! Gets the contents of the key as an INTEGER(INT32) vector
@@ -340,17 +340,17 @@ subroutine set_int8_key( key, value )
340340
end subroutine set_int8_key
341341

342342

343-
subroutine set_int32_key( key, value )
343+
pure subroutine set_int32_key( key, value )
344344
!! Version: Experimental
345345
!!
346346
!! Sets the contents of the key from an INTEGER(INT32) vector
347347
!! Arguments:
348348
!! key - the output key
349349
!! value - the input INTEGER(INT32) vector
350-
type(key_type), intent(out) :: key
351-
integer(int32), intent(in) :: value(:)
350+
type(key_type), intent(out) :: key
351+
integer(int32), intent(in) :: value(:)
352352

353-
key % value = transfer(value, key % value)
353+
key % value = transfer(value, key % value)
354354

355355
end subroutine set_int32_key
356356

test/hashmaps/test_maps.fypp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ module test_stdlib_chaining_maps
2424
integer, parameter :: test_size = rand_size*4
2525
integer, parameter :: test_16 = 2**4
2626
integer, parameter :: test_256 = 2**8
27+
! key_type = 2 to support int8 and int32 key types tested. Can be
28+
! icreased to generate additional unique int8 vectors additional key types.
2729
integer, parameter :: key_types = 2
2830
public :: collect_stdlib_chaining_maps
2931

@@ -275,6 +277,8 @@ module test_stdlib_open_maps
275277
integer, parameter :: test_size = rand_size*4
276278
integer, parameter :: test_16 = 2**4
277279
integer, parameter :: test_256 = 2**8
280+
! key_type = 2 to support int8 and int32 key types tested. Can be
281+
! icreased to generate additional unique int8 vectors additional key types.
278282
integer, parameter :: key_types = 2
279283

280284
public :: collect_stdlib_open_maps

0 commit comments

Comments
 (0)