Closed stephanemagnenat closed 4 years ago
What you propose would not build, for the same reason this doesn't build point2(self.x * scale, self.y * scale)
. You need to clone the scale once so you can use it again. But you don't need to clone it twice, thus the current thing.
In practice for types that are both Clone
and Copy
, there's no difference.
In several part of euclid's source code, for example in
Point2D
multiplied by a scale, the scale is cloned and applied to x, but applied to y uncloned:I do not understand this difference. Could it be a bug, copy-pasted in multiple places? Would the right implementation be:
? Being it so pervasive, I doubt it is a bug, yet I cannot see a reason, hence this issue.