Skip to content

Commit 8c9f2fa

Browse files
committed
Test allocate again
Try allocate(new_ent % other, source = other) one more time.
1 parent 642436a commit 8c9f2fa

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/stdlib_hashmap_chaining.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,8 @@ module subroutine map_chain_entry(map, key, other, conflict)
569569
new_ent % next => map % slots(hash_index) % target
570570
map % slots(hash_index) % target => new_ent
571571
call copy_key( key, new_ent % key )
572-
if ( present(other) ) new_ent % other = other
572+
!if ( present(other) ) new_ent % other = other
573+
if ( present(other) ) allocate(new_ent % other, source = other)
573574
if ( new_ent % inmap == 0 ) then
574575
map % num_entries = map % num_entries + 1
575576
inmap = map % num_entries

src/stdlib_hashmap_open.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,8 @@ module subroutine map_open_entry(map, key, other, conflict)
554554
new_ent % hash_val = hash_val
555555
call copy_key( key, new_ent % key )
556556
if ( present( other ) ) &
557-
new_ent % other = other
557+
!new_ent % other = other
558+
allocate(new_ent % other, source = other)
558559
inmap = new_ent % inmap
559560
map % inverse( inmap ) % target => new_ent
560561
map % slots( test_slot ) = inmap

0 commit comments

Comments
 (0)