Skip to content

Commit

Permalink
remove matches var as unused, see PR discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
wkdewey committed May 19, 2022
1 parent 102de7b commit 4b92510
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/services/search_item_res.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ def find_source_from_top_hits(top_hits, field, key)
match_index = hit
.map { |s| remove_nonword_chars(s) }
.index(remove_nonword_chars(key))
matches = hit.map { |s| remove_nonword_chars(s) }
# if nothing matches the original key, return the entire source hit
# should return a string, regardless
return match_index ? matches[match_index] : matches.join(" ")
return match_index ? hit[match_index] : hit.join(" ")
else
# it must be single-valued and therefore we are good to go
return hit
Expand Down

0 comments on commit 4b92510

Please sign in to comment.