Skip to content

Commit 8be0f18

Browse files
committed
Refactoring: fewer variables, slightly faster code
The previous code made me wonder why we had to use a variable that was used only once: I was wondering whether `get_figlabels()` had any side effect. Not only is the fact that this is not the case now explicit, but the code does not do any unnecessary call to `get_figlabels()` anymore.
1 parent a2fd30d commit 8be0f18

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/matplotlib/pyplot.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,7 @@ def gcf():
461461
return figure()
462462

463463
def fignum_exists(num):
464-
allLabels = get_figlabels()
465-
return _pylab_helpers.Gcf.has_fignum(num) or num in allLabels
464+
return _pylab_helpers.Gcf.has_fignum(num) or num in get_figlabels()
466465

467466

468467
def get_fignums():

0 commit comments

Comments
 (0)