Skip to content

Commit 4b92510

Browse files
committed
remove matches var as unused, see PR discussion
1 parent 102de7b commit 4b92510

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

app/services/search_item_res.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ def find_source_from_top_hits(top_hits, field, key)
5353
match_index = hit
5454
.map { |s| remove_nonword_chars(s) }
5555
.index(remove_nonword_chars(key))
56-
matches = hit.map { |s| remove_nonword_chars(s) }
5756
# if nothing matches the original key, return the entire source hit
5857
# should return a string, regardless
59-
return match_index ? matches[match_index] : matches.join(" ")
58+
return match_index ? hit[match_index] : hit.join(" ")
6059
else
6160
# it must be single-valued and therefore we are good to go
6261
return hit

0 commit comments

Comments
 (0)