Skip to content

Commit 5a9ccff

Browse files
committed
simplifies code by adding fypp variables
1 parent e8d80de commit 5a9ccff

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

src/stdlib_sorting.fypp

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#:include "common.fypp"
2+
#:set IR_KINDS_TYPES = INT_KINDS_TYPES + REAL_KINDS_TYPES
23

34
!! Licensing:
45
!!
@@ -346,29 +347,18 @@ module stdlib_sorting
346347
!! sorted data, having O(N) performance on uniformly non-increasing or
347348
!! non-decreasing data.
348349

349-
#:for k1 in INT_KINDS
350+
#:for k1, t1 in IR_KINDS_TYPES
350351
module subroutine ${k1}$_ord_sort( array, work )
351352
!! Version: experimental
352353
!!
353-
!! `${k1}$_ord_sort( array )` sorts the input `ARRAY` of type `INTEGER(${k1}$)`
354+
!! `${k1}$_ord_sort( array )` sorts the input `ARRAY` of type `${t1}$`
354355
!! using a hybrid sort based on the `'Rust" sort` algorithm found in `slice.rs`
355-
integer(${k1}$), intent(inout) :: array(0:)
356-
integer(${k1}$), intent(inout), optional :: work(0:)
356+
${t1}$, intent(inout) :: array(0:)
357+
${t1}$, intent(inout), optional :: work(0:)
357358
end subroutine ${k1}$_ord_sort
358359

359360
#:endfor
360361

361-
#:for k1 in REAL_KINDS
362-
module subroutine ${k1}$_ord_sort( array, work )
363-
!! Version: experimental
364-
!!
365-
!! `${k1}$_ord_sort( array )` sorts the input `ARRAY` of type `REAL(${k1}$)`
366-
!! using a hybrid sort based on the `'Rust" sort` algorithm found in `slice.rs`
367-
real(${k1}$), intent(inout) :: array(0:)
368-
real(${k1}$), intent(inout), optional :: work(0:)
369-
end subroutine ${k1}$_ord_sort
370-
371-
#:endfor
372362
module subroutine char_ord_sort( array, work )
373363
!! Version: experimental
374364
!!

0 commit comments

Comments
 (0)