diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2019-05-05 13:12:13 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2019-05-21 12:03:47 -0400 |
commit | edb14713a67cb1b081086cd4743ef27ab117c55d (patch) | |
tree | 00fae82c83b3a1a070d1dcb1f3d5e4d1792e10e7 | |
parent | flow, rename functions with multiple return values (diff) |
questionable code, clean ("flow" commit related)
-rw-r--r-- | org/meta_abstraction.org | 11 | ||||
-rw-r--r-- | src/doc_reform/meta/metadoc_from_src.d | 11 |
2 files changed, 8 insertions, 14 deletions
diff --git a/org/meta_abstraction.org b/org/meta_abstraction.org index f657eb8..d050abb 100644 --- a/org/meta_abstraction.org +++ b/org/meta_abstraction.org @@ -7122,7 +7122,7 @@ struct Bibliography { } body { JSONValue[] biblio_unsorted - = flow_biblio_unsorted_complete_(biblio_unsorted_incomplete, bib_arr_json); + = biblio_make_unsorted_array_of_json_objects(biblio_unsorted_incomplete, bib_arr_json); // TODO lookat returns biblio_arr_json = []; biblio_unsorted_incomplete = []; JSONValue[] biblio_sorted__ = biblio_sort(biblio_unsorted); @@ -7148,9 +7148,9 @@ struct Bibliography { #+name: meta_emitters_bibliography #+BEGIN_SRC d - final private JSONValue[] flow_biblio_unsorted_complete_(Bi,BJ)( + final private JSONValue[] biblio_make_unsorted_array_of_json_objects(Bi,BJ)( Bi biblio_unordered, - return ref BJ bib_arr_json + BJ bib_arr_json ) { debug(asserts) { static assert(is(typeof(biblio_unordered) == string[])); @@ -7178,10 +7178,7 @@ struct Bibliography { } bib_arr_json ~= j; } - JSONValue[] biblio_unsorted_array_of_json_objects - = bib_arr_json.dup; - destroy(bib_arr_json); - return biblio_unsorted_array_of_json_objects; + return bib_arr_json.dup; } #+END_SRC diff --git a/src/doc_reform/meta/metadoc_from_src.d b/src/doc_reform/meta/metadoc_from_src.d index 801ebba..f603ab8 100644 --- a/src/doc_reform/meta/metadoc_from_src.d +++ b/src/doc_reform/meta/metadoc_from_src.d @@ -5738,7 +5738,7 @@ template DocReformDocAbstraction() { } body { JSONValue[] biblio_unsorted - = flow_biblio_unsorted_complete_(biblio_unsorted_incomplete, bib_arr_json); + = biblio_make_unsorted_array_of_json_objects(biblio_unsorted_incomplete, bib_arr_json); // TODO lookat returns biblio_arr_json = []; biblio_unsorted_incomplete = []; JSONValue[] biblio_sorted__ = biblio_sort(biblio_unsorted); @@ -5758,9 +5758,9 @@ template DocReformDocAbstraction() { } return biblio_sorted__; } - final private JSONValue[] flow_biblio_unsorted_complete_(Bi,BJ)( + final private JSONValue[] biblio_make_unsorted_array_of_json_objects(Bi,BJ)( Bi biblio_unordered, - return ref BJ bib_arr_json + BJ bib_arr_json ) { debug(asserts) { static assert(is(typeof(biblio_unordered) == string[])); @@ -5788,10 +5788,7 @@ template DocReformDocAbstraction() { } bib_arr_json ~= j; } - JSONValue[] biblio_unsorted_array_of_json_objects - = bib_arr_json.dup; - destroy(bib_arr_json); - return biblio_unsorted_array_of_json_objects; + return bib_arr_json.dup; } final private JSONValue[] biblio_sort(BJ)(BJ biblio_unordered) { debug(asserts) { |