Skip to content

Commit 4b16aca

Browse files
committed
ord_sort: add fypp variable to reduce code
1 parent 3f8bea7 commit 4b16aca

File tree

2 files changed

+6
-353
lines changed

2 files changed

+6
-353
lines changed

src/stdlib_sorting.fypp

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

54
!! Licensing:
@@ -328,11 +327,11 @@ module stdlib_sorting
328327

329328
public char_sort_index
330329

331-
public string_ord_sort
330+
public string_type_ord_sort
332331

333-
public string_sort
332+
public string_type_sort
334333

335-
public string_sort_index
334+
public string_type_sort_index
336335

337336
interface ord_sort
338337
!! Version: experimental
@@ -348,7 +347,7 @@ module stdlib_sorting
348347
!! sorted data, having O(N) performance on uniformly non-increasing or
349348
!! non-decreasing data.
350349

351-
#:for k1, t1 in IR_KINDS_TYPES
350+
#:for k1, t1 in IRS_KINDS_TYPES
352351
module subroutine ${k1}$_ord_sort( array, work )
353352
!! Version: experimental
354353
!!
@@ -369,15 +368,6 @@ module stdlib_sorting
369368
character(len=len(array)), intent(inout), optional :: work(0:)
370369
end subroutine char_ord_sort
371370

372-
module subroutine string_ord_sort( array, work )
373-
!! Version: experimental
374-
!!
375-
!! `char_ord_sort( array )` sorts the input `ARRAY` of type `CHARACTER(*)`
376-
!! using a hybrid sort based on the `'Rust" sort` algorithm found in `slice.rs`
377-
type(string_type), intent(inout) :: array(0:)
378-
type(string_type), intent(inout), optional :: work(0:)
379-
end subroutine string_ord_sort
380-
381371
end interface ord_sort
382372

383373
interface sort

0 commit comments

Comments
 (0)