Skip to content

Commit

Permalink
Removed redundant array loop in search-engine.ts (oliverschwendener#809)
Browse files Browse the repository at this point in the history
  • Loading branch information
NotWearingPants authored Oct 3, 2021
1 parent 1c37aae commit 99eb5ba
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/search-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ export class SearchEngine {

public autoComplete(searchResultItem: SearchResultItem): string {
const originPlugin = this.getAllPlugins()
.filter((plugin) => plugin.isEnabled())
.find((plugin) => plugin.pluginType === searchResultItem.originPluginType);
.find((plugin) => plugin.isEnabled() && plugin.pluginType === searchResultItem.originPluginType);

if (originPlugin && this.pluginSupportsAutocompletion(originPlugin)) {
return originPlugin.autoComplete(searchResultItem);
Expand Down

0 comments on commit 99eb5ba

Please sign in to comment.