Skip to content

Commit 7d416cf

Browse files
committed
Simplify logic in merge_other
1 parent fc33c38 commit 7d416cf

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,10 @@ def clear_doc(self, app, env, docname):
345345
del env.mpl_plot_image_basenames[docname]
346346

347347
def merge_other(self, app, env, docnames, other):
348-
for docname in docnames:
349-
if docname in other.mpl_plot_image_basenames:
350-
if docname not in env.mpl_plot_image_basenames:
351-
env.mpl_plot_image_basenames[docname] = set()
352-
env.mpl_plot_image_basenames[docname].update(
353-
other.mpl_plot_image_basenames[docname])
348+
for docname in other.mpl_plot_image_basenames:
349+
env.mpl_plot_image_basenames[docname].update(
350+
other.mpl_plot_image_basenames[docname])
351+
354352

355353
# -----------------------------------------------------------------------------
356354
# Doctest handling

0 commit comments

Comments
 (0)