Skip to content

Commit

Permalink
fix RubricCollector.clear_doc()
Browse files Browse the repository at this point in the history
  • Loading branch information
mattheww committed Oct 23, 2023
1 parent 26cdabb commit 7d84415
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions exts/ferrocene_spec/items_with_rubric.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ class RubricCollector(EnvironmentCollector):
def clear_doc(self, app, env, docname):
storage = get_storage(env)
for rubric, items in storage.items():
# This makes a copy of the list (with `list(items)`) to be able to
# remove items from it without affecting the iteration.
for i, item in enumerate(list(items)):
if item.document == docname:
items.pop(i)
items[:] = (item for item in items if item.document != docname)

def merge_other(self, app, env, docnames, other):
current = get_storage(env)
Expand Down

0 comments on commit 7d84415

Please sign in to comment.