Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MathKit.swift #2346

Merged
merged 1 commit into from
Mar 22, 2024
Merged

Update MathKit.swift #2346

merged 1 commit into from
Mar 22, 2024

Conversation

soo941226
Copy link
Contributor

Hello. before to describe change, I want to ask about below code.

// Sources/Private/Utility/Extensions/MathKit.swift:L273~

/// Operator convenience to divide points with /
static func / (lhs: CGPoint, rhs: CGFloat) -> CGPoint {
  CGPoint(x: lhs.x / CGFloat(rhs), y: lhs.y / CGFloat(rhs))
}

/// Operator convenience to multiply points with *
static func * (lhs: CGPoint, rhs: CGFloat) -> CGPoint {
  CGPoint(x: lhs.x * CGFloat(rhs), y: lhs.y * CGFloat(rhs))
}

I think CGFloat.init(_ value: CGFloat) will return same value. so I don't know why use this initializer here. In this case It just copy same value, and use some CPU and Memory to do it.

If you don't have some reason, please consider it to merge this pull request. Thanks you

@calda calda merged commit 833bc7b into airbnb:master Mar 22, 2024
13 checks passed
MoroziOS pushed a commit to MoroziOS/tmg-lottie-ios that referenced this pull request May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants