Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Set to improve lookup performance (#1086)
<!-- Thanks for your contribution! Please ensure that any applicable requirements below are satisfied before submitting this pull request. This will help ensure a quick and efficient review cycle. --> **Improve lookup time in PhishingController** This PR creates a Set from `metamaskConfig.blocklist` in the `PhishingController`. The blocklist Set is later used as a lookup inside of a filter method. As a result, look up performance is significantly improved by using a `Set` + `has` method instead of `includes` method from an Array. **Description** _Itemize the changes you have made into the categories below_ - CHANGED: - `PhishingController.updatePhishingLists` - Create a `Set` from `metamaskConfig.blocklist` to be used as lookup. **Checklist** - [x] Tests are included if applicable - [x] Any added code is fully documented **Issue** Resolves MetaMask/metamask-mobile#5382
- Loading branch information