Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

about:newtab - Update the unpinned site list to only show one result per domain #5593

Merged
merged 1 commit into from
Nov 14, 2016
Merged

about:newtab - Update the unpinned site list to only show one result per domain #5593

merged 1 commit into from
Nov 14, 2016

Conversation

bsclifton
Copy link
Member

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

about:newtab - Update the unpinned site list to only show one result per domain

Fixes #5565

Auditors: @bbondy

return list.filter((site) => {
try {
const hostname = require('url').parse(site.get('location')).hostname
if (!siteDomains.includes(hostname)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls use a Set here, or just indexing inside an object is fine. You can make this O(N) or O(NlogN) depending on complexity of lookups in an ES6 Set. Which is much better than the current O(N^2).

…per domain.

Fixes #5565

Auditors: @bbondy

UPDATE:
- Updated unique check from array => set
Auditors: @bbondy
@bbondy
Copy link
Member

bbondy commented Nov 14, 2016

++

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants