|
15 | 15 | ! throughout the PR
|
16 | 16 | !
|
17 | 17 | module stdlib_stringlist_type
|
18 |
| - use stdlib_string_type, only: string_type, operator(/=) |
| 18 | + use stdlib_string_type, only: string_type, operator(/=), move |
19 | 19 | use stdlib_math, only: clip
|
20 | 20 | implicit none
|
21 | 21 | private
|
@@ -600,13 +600,11 @@ subroutine insert_before_empty_positions( list, idxn, positions )
|
600 | 600 | allocate( new_stringarray(new_len) )
|
601 | 601 |
|
602 | 602 | do i = 1, idxn - 1
|
603 |
| - ! TODO: can be improved by move |
604 |
| - new_stringarray(i) = list%stringarray(i) |
| 603 | + call move( list%stringarray(i), new_stringarray(i) ) |
605 | 604 | end do
|
606 | 605 | do i = idxn, old_len
|
607 | 606 | inew = i + positions
|
608 |
| - ! TODO: can be improved by move |
609 |
| - new_stringarray(inew) = list%stringarray(i) |
| 607 | + call move( list%stringarray(i), new_stringarray(inew) ) |
610 | 608 | end do
|
611 | 609 |
|
612 | 610 | call move_alloc( new_stringarray, list%stringarray )
|
@@ -766,13 +764,11 @@ impure function delete_string_idx_impl( list, idx )
|
766 | 764 | allocate( new_stringarray(new_len) )
|
767 | 765 |
|
768 | 766 | do i = 1, idxn - 1
|
769 |
| - ! TODO: can be improved by move |
770 |
| - new_stringarray(i) = list%stringarray(i) |
| 767 | + call move( list%stringarray(i), new_stringarray(i) ) |
771 | 768 | end do
|
772 | 769 | do i = idxn + 1, old_len
|
773 | 770 | inew = i - 1
|
774 |
| - ! TODO: can be improved by move |
775 |
| - new_stringarray(inew) = list%stringarray(i) |
| 771 | + call move( list%stringarray(i), new_stringarray(inew) ) |
776 | 772 | end do
|
777 | 773 |
|
778 | 774 | call move_alloc( new_stringarray, list%stringarray )
|
|
0 commit comments