Browse Source

Remove slow Array.from, use $.fn.get (#443)

* Remove Array.from from diffheader.js

* Remove Array.from from shownames.js
master
Federico Brigante 8 years ago
committed by Sindre Sorhus
parent
commit
9e39197979
  1. 2
      extension/diffheader.js
  2. 2
      extension/show-names.js

2
extension/diffheader.js

@ -78,7 +78,7 @@ window.diffFileHeader = (() => {
return;
}
const files = Array.from($('.file.js-details-container'));
const files = $('.file.js-details-container').get();
return files.find(el => isFilePartlyVisible(el, toolbarHeight));
};

2
extension/show-names.js

@ -18,7 +18,7 @@ window.showRealNames = () => {
};
getCachedUsers((users = {}) => {
const usersOnPage = Array.from($('.js-discussion .author')).map(el => el.innerText);
const usersOnPage = $('.js-discussion .author').get().map(el => el.innerText);
const uniqueUsers = new Set(usersOnPage);
// Add cached users to DOM first, since the calls for everyone else will be slow

Loading…
Cancel
Save