Skip to content

Commit c971053

Browse files
committed
Roll back rank_1 changes
Roll back rank_1 unlimited polymorphic changes to work around a Gfortran bug that was causing those features to crash. Currently Gfortran seems to only support unlimited polymorphic scalar values for the transfer intrinsic.
1 parent b7d87b8 commit c971053

File tree

2 files changed

+224
-92
lines changed

2 files changed

+224
-92
lines changed

src/stdlib_hashmap_wrappers.f90

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ end function hasher_fun
9090
interface set
9191

9292
module procedure set_scalar_key, &
93-
set_rank_one_key
93+
set_int8_key, &
94+
set_int32_key
9495

9596
end interface set
9697

@@ -250,28 +251,36 @@ subroutine set_scalar_key( key, value )
250251
end subroutine set_scalar_key
251252

252253

253-
subroutine set_rank_one_key( key, value )
254+
pure subroutine set_int8_key( key, value )
254255
!! Version: Experimental
255256
!!
256-
!! Sets the contents of the key from a rank one array of any type
257+
!! Sets the contents of the key from an INTEGER(INT8) vector
257258
!! Arguments:
258259
!! key - the output key
259260
!! value - the input rank one array of any type
260261
type(key_type), intent(out) :: key
261-
class(*), intent(in) :: value(:)
262-
263-
select type (value)
264-
type is (integer(int8))
265-
key % value = value
266-
267-
class default
268-
key % value = transfer( value, key % value )
262+
integer(int8), intent(in) :: value(:)
269263

270-
end select
271-
272-
end subroutine set_rank_one_key
264+
key % value = value
273265

266+
end subroutine set_int8_key
274267

268+
269+
pure subroutine set_int32_key( key, value )
270+
!! Version: Experimental
271+
!!
272+
!! Sets the contents of the key from an INTEGER(INT32) vector
273+
!! Arguments:
274+
!! key - the output key
275+
!! value - the input INTEGER(INT32) vector
276+
type(key_type), intent(out) :: key
277+
integer(int32), intent(in) :: value(:)
278+
279+
key % value = transfer(value, key % value)
280+
281+
end subroutine set_int32_key
282+
283+
275284
pure function fnv_1_hasher( key )
276285
!! Version: Experimental
277286
!!

0 commit comments

Comments
 (0)