mirror of
https://github.com/SoPat712/videospeed.git
synced 2025-08-22 02:18:45 -04:00
big performance gains by deleting .concat and adding in .push and .flat!
This commit is contained in:
@@ -365,17 +365,17 @@ function getShadow(parent) {
|
|||||||
if (parent.firstElementChild) {
|
if (parent.firstElementChild) {
|
||||||
var child = parent.firstElementChild;
|
var child = parent.firstElementChild;
|
||||||
do {
|
do {
|
||||||
result = result.concat(child);
|
result.push(child);
|
||||||
getChild(child);
|
getChild(child);
|
||||||
if (child.shadowRoot) {
|
if (child.shadowRoot) {
|
||||||
result = result.concat(getShadow(child.shadowRoot));
|
result.push(getShadow(child.shadowRoot));
|
||||||
}
|
}
|
||||||
child = child.nextElementSibling;
|
child = child.nextElementSibling;
|
||||||
} while (child);
|
} while (child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getChild(parent);
|
getChild(parent);
|
||||||
return result;
|
return result.flat(Infinity);
|
||||||
}
|
}
|
||||||
function getController(id) {
|
function getController(id) {
|
||||||
return getShadow(document.body).filter(x => {
|
return getShadow(document.body).filter(x => {
|
||||||
|
Reference in New Issue
Block a user