Skip to content

Commit 508541a

Browse files
committed
Remove repeated computation
1 parent aeef04b commit 508541a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2820,13 +2820,15 @@ def permutation_matrices(n):
28202820
qinds = np.arange(qc)
28212821
rinds = np.arange(rc)
28222822

2823+
square_rot = square.dot(permute.T)
2824+
28232825
for p in pinds:
28242826
for q in qinds:
28252827
# draw lower faces
28262828
p0 = permute.dot([p, q, 0])
28272829
i0 = tuple(p0)
28282830
if filled[i0]:
2829-
boundary_found(p0 + square.dot(permute.T), color[i0])
2831+
boundary_found(p0 + square_rot, color[i0])
28302832

28312833
# draw middle faces
28322834
for r1, r2 in zip(rinds, rinds[1:]):
@@ -2837,16 +2839,16 @@ def permutation_matrices(n):
28372839
i2 = tuple(p2)
28382840

28392841
if filled[i1] and not filled[i2]:
2840-
boundary_found(p2 + square.dot(permute.T), color[i1])
2842+
boundary_found(p2 + square_rot, color[i1])
28412843
elif not filled[i1] and filled[i2]:
2842-
boundary_found(p2 + square.dot(permute.T), color[i2])
2844+
boundary_found(p2 + square_rot, color[i2])
28432845

28442846
# draw upper faces
28452847
pk = permute.dot([p, q, rc-1])
28462848
pk2 = permute.dot([p, q, rc])
28472849
ik = tuple(pk)
28482850
if filled[ik]:
2849-
boundary_found(pk2 + square.dot(permute.T), color[ik])
2851+
boundary_found(pk2 + square_rot, color[ik])
28502852

28512853
return polygons
28522854

0 commit comments

Comments
 (0)