No need to spread a filtered array

This commit is contained in:
Jordan Brown
2024-11-19 11:53:21 -05:00
parent 5d7cc78ded
commit 72b6f1ba56
2 changed files with 1 additions and 7 deletions
@@ -43,11 +43,7 @@ export function inferEffectDependencies(
if (fnExpr != null) {
const deps: ArrayExpression = {
kind: 'ArrayExpression',
elements: [
...fnExpr.loweredFunc.dependencies.filter(
place => place.reactive,
),
],
elements: fnExpr.loweredFunc.dependencies.filter(place => place.reactive),
loc: GeneratedSource,
};
@@ -14,7 +14,6 @@ function Component({foo, bar}) {
console.log(localNonreactive);
console.log(globalValue);
});
// Optional chains and property accesses
// TODO: we may be able to save bytes by omitting property accesses if the
@@ -22,7 +21,6 @@ function Component({foo, bar}) {
useEffect(() => {
console.log(bar?.baz);
console.log(bar.qux);
});
function f() {