Skip to content

Commit

Permalink
Update src/stdlib_string_type.fypp
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Ehlert <[email protected]>
  • Loading branch information
jvdp1 and awvwgk authored Sep 4, 2023
1 parent ae4a38f commit 8f088b3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/stdlib_string_type.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -681,11 +681,10 @@ contains
elemental subroutine move_string_string(from, to)
type(string_type), intent(inout) :: from
type(string_type), intent(inout) :: to
character(:), allocatable :: tmp

if(.not.allocated(from%raw))then
if(allocated(to%raw))deallocate(to%raw)
return
endif
call move_alloc(from%raw, tmp)
call move_alloc(tmp, to%raw)

if(from%raw .eq. to%raw)then
deallocate(from%raw)
Expand Down

0 comments on commit 8f088b3

Please sign in to comment.