File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Original file line number Diff line number Diff line change @@ -1244,13 +1244,12 @@ def set_verts(self, verts, closed=True):
1244
1244
# Fast path for arrays
1245
1245
if isinstance (verts , np .ndarray ) and len (verts .shape ) == 3 and verts .size :
1246
1246
verts_pad = np .concatenate ((verts , verts [:, :1 ]), axis = 1 )
1247
- # Creating the codes once is much faster than having Path do it
1248
- # separately each time by passing closed=True .
1249
- example_path = mpath .Path (verts_pad [0 ], closed = True )
1250
- # Looking up the values once speeds up the iteration a bit
1247
+ # It's faster to create the codes and internal flags once in a
1248
+ # template path and reuse them .
1249
+ template_path = mpath .Path (verts_pad [0 ], closed = True )
1250
+ codes = template_path . codes
1251
1251
_make_path = mpath .Path ._fast_from_codes_and_verts
1252
- codes = example_path .codes
1253
- self ._paths = [_make_path (xy , codes , internals_from = example_path )
1252
+ self ._paths = [_make_path (xy , codes , internals_from = template_path )
1254
1253
for xy in verts_pad ]
1255
1254
return
1256
1255
You can’t perform that action at this time.
0 commit comments