Avoid double-execution within a round; see syndicate-lang/syndicate-js#3
This commit is contained in:
parent
3b4d0ef418
commit
79c3788436
|
@ -41,8 +41,11 @@ class Graph:
|
||||||
|
|
||||||
repaired_this_round = repaired_this_round | workset
|
repaired_this_round = repaired_this_round | workset
|
||||||
|
|
||||||
|
updated_subjects = set()
|
||||||
for object_id in workset:
|
for object_id in workset:
|
||||||
for subject_id in self.observers_of(object_id):
|
for subject_id in self.observers_of(object_id):
|
||||||
|
if subject_id not in updated_subjects:
|
||||||
|
updated_subjects.add(subject_id)
|
||||||
self.forget_subject(subject_id)
|
self.forget_subject(subject_id)
|
||||||
self.with_subject(subject_id, lambda: repair_fn(subject_id))
|
self.with_subject(subject_id, lambda: repair_fn(subject_id))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue