Skip to content

Commit 51fccc8

Browse files
committed
Shorten.
1 parent 4071cdb commit 51fccc8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/runtime.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,10 @@ function runtime_computeNow() {
159159
}
160160

161161
function variable_circular(variable) {
162-
const seen = new Set().add(variable);
163-
for (const v of seen) {
164-
for (const o of v._inputs) {
165-
if (o === variable) return true;
166-
seen.add(o);
167-
}
162+
const inputs = new Set(variable._inputs);
163+
for (const i of inputs) {
164+
if (i === variable) return true;
165+
i._inputs.forEach(inputs.add, inputs);
168166
}
169167
return false;
170168
}

0 commit comments

Comments
 (0)