Avoid double-execution within a round; see syndicate-lang/syndicate-js#3

This commit is contained in:
Tony Garnock-Jones 2023-12-19 23:15:00 +13:00
parent 3b4d0ef418
commit 79c3788436
1 changed files with 5 additions and 2 deletions

View File

@ -41,10 +41,13 @@ class Graph:
repaired_this_round = repaired_this_round | workset
updated_subjects = set()
for object_id in workset:
for subject_id in self.observers_of(object_id):
self.forget_subject(subject_id)
self.with_subject(subject_id, lambda: repair_fn(subject_id))
if subject_id not in updated_subjects:
updated_subjects.add(subject_id)
self.forget_subject(subject_id)
self.with_subject(subject_id, lambda: repair_fn(subject_id))
__nextFieldId = 0