Skip to content

Commit 2ed9fcd

Browse files
committed
Deploying to stdlib-fpm from @ 7211ce8 🚀
1 parent 450ec76 commit 2ed9fcd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/stdlib_string_type.f90

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -686,12 +686,13 @@ end function verify_char_string
686686
!> Moves the allocated character scalar from 'from' to 'to'
687687
!> No output
688688
elemental subroutine move_string_string(from, to)
689-
type(string_type), intent(inout) :: from
690-
type(string_type), intent(inout) :: to
691-
character(:), allocatable :: tmp
689+
type(string_type), intent(inout), target :: from
690+
type(string_type), intent(inout), target :: to
691+
type(string_type), pointer :: fromp
692692

693-
call move_alloc(from%raw, tmp)
694-
call move_alloc(tmp, to%raw)
693+
fromp => from
694+
if (associated(fromp,to)) return
695+
call move_alloc(from%raw, to%raw)
695696

696697
end subroutine move_string_string
697698

0 commit comments

Comments
 (0)