|
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 ) |
@@ -762,13 +760,11 @@ impure function delete_string_idx_impl( list, idx ) |
762 | 760 | allocate( new_stringarray(new_len) ) |
763 | 761 |
|
764 | 762 | do i = 1, idxn - 1 |
765 | | - ! TODO: can be improved by move |
766 | | - new_stringarray(i) = list%stringarray(i) |
| 763 | + call move( list%stringarray(i), new_stringarray(i) ) |
767 | 764 | end do |
768 | 765 | do i = idxn + 1, old_len |
769 | 766 | inew = i - 1 |
770 | | - ! TODO: can be improved by move |
771 | | - new_stringarray(inew) = list%stringarray(i) |
| 767 | + call move( list%stringarray(i), new_stringarray(inew) ) |
772 | 768 | end do |
773 | 769 |
|
774 | 770 | call move_alloc( new_stringarray, list%stringarray ) |
|
0 commit comments