Skip to content

Commit 4071cdb

Browse files
committed
Tweak.
1 parent 7ae07b6 commit 4071cdb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/runtime.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ function runtime_computeNow() {
126126
variable._outputs.forEach(variable_increment);
127127
});
128128

129-
while (variables.size) {
130-
129+
do {
131130
// Identify the root variables (those with no updating inputs).
132131
variables.forEach(function(variable) {
133132
if (variable._indegree === 0) {
@@ -142,15 +141,15 @@ function runtime_computeNow() {
142141
variables.delete(variable);
143142
}
144143

145-
// Any remaining variables have circular definitions.
144+
// Any remaining variables are circular, or depend on them.
146145
variables.forEach(function(variable) {
147146
if (variable_circular(variable)) {
148147
variable_error(variable, new RuntimeError("circular definition"));
149148
variable._outputs.forEach(variable_decrement);
150149
variables.delete(variable);
151150
}
152151
});
153-
}
152+
} while (variables.size);
154153

155154
function postqueue(variable) {
156155
if (--variable._indegree === 0) {

0 commit comments

Comments
 (0)