Skip to content

Commit 4390b13

Browse files
committed
Optimize point copying: copy only if necessary
1 parent 3e64869 commit 4390b13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

manim/mobject/types/vectorized_mobject.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1939,7 +1939,7 @@ def pointwise_become_partial(
19391939
)
19401940
else:
19411941
# make a copy of points before setting self.points = np.empty(...)
1942-
vmobject_points = vmobject.points.copy()
1942+
vmobject_points = vmobject.points.copy() if self.points is vmobject.points else vmobject.points
19431943

19441944
# Allocate space for (upper_index-lower_index+1) Bézier curves.
19451945
self.points = np.empty((nppc * (upper_index - lower_index + 1), self.dim))

0 commit comments

Comments
 (0)