Skip to content

Commit

Permalink
add ToDos re more efficient code
Browse files Browse the repository at this point in the history
  • Loading branch information
qqmyers committed Apr 29, 2022
1 parent 1ee29e4 commit cbe1327
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/api/Index.java
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ public String getSolrSchema() {
StringBuilder sb = new StringBuilder();

for (DatasetFieldType datasetField : datasetFieldService.findAllOrderedByName()) {
//ToDo - getSolrField() creates/returns a new object - just get it once and re-use
String nameSearchable = datasetField.getSolrField().getNameSearchable();
SolrField.SolrType solrType = datasetField.getSolrField().getSolrType();
String type = solrType.getType();
Expand Down Expand Up @@ -490,7 +491,7 @@ public String getSolrSchema() {
}

sb.append("---\n");

//ToDo - this is the same for loop as above - could combine into one by using a second string buffer and appending the latter one after the loop.
for (DatasetFieldType datasetField : datasetFieldService.findAllOrderedByName()) {
String nameSearchable = datasetField.getSolrField().getNameSearchable();
String nameFacetable = datasetField.getSolrField().getNameFacetable();
Expand Down

0 comments on commit cbe1327

Please sign in to comment.