Skip to content

Commit

Permalink
Slice search results only when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneLem committed Apr 18, 2017
1 parent 4a9497d commit 6a3b05d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/emoji-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function search(value, emojisToShowFilter = () => true, maxResults = 75) {
results = results.filter((result) => emojisToShowFilter(data.emojis[result.id].unified))
}

if (results && results.length) {
if (results && results.length > maxResults) {
results = results.slice(0, maxResults)
}
}
Expand Down

0 comments on commit 6a3b05d

Please sign in to comment.