Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b512591

Browse files
committed
Remove repeated computation
1 parent be532e3 commit b512591

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
@@ -2725,13 +2725,15 @@ def permutation_matrices(n):
27252725
qinds = np.arange(qc)
27262726
rinds = np.arange(rc)
27272727

2728+
square_rot = square.dot(permute.T)
2729+
27282730
for p in pinds:
27292731
for q in qinds:
27302732
# draw lower faces
27312733
p0 = permute.dot([p, q, 0])
27322734
i0 = tuple(p0)
27332735
if filled[i0]:
2734-
boundary_found(p0 + square.dot(permute.T), color[i0])
2736+
boundary_found(p0 + square_rot, color[i0])
27352737

27362738
# draw middle faces
27372739
for r1, r2 in zip(rinds, rinds[1:]):
@@ -2742,16 +2744,16 @@ def permutation_matrices(n):
27422744
i2 = tuple(p2)
27432745

27442746
if filled[i1] and not filled[i2]:
2745-
boundary_found(p2 + square.dot(permute.T), color[i1])
2747+
boundary_found(p2 + square_rot, color[i1])
27462748
elif not filled[i1] and filled[i2]:
2747-
boundary_found(p2 + square.dot(permute.T), color[i2])
2749+
boundary_found(p2 + square_rot, color[i2])
27482750

27492751
# draw upper faces
27502752
pk = permute.dot([p, q, rc-1])
27512753
pk2 = permute.dot([p, q, rc])
27522754
ik = tuple(pk)
27532755
if filled[ik]:
2754-
boundary_found(pk2 + square.dot(permute.T), color[ik])
2756+
boundary_found(pk2 + square_rot, color[ik])
27552757

27562758
return polygons
27572759

0 commit comments

Comments
 (0)