Skip to content

use switch-case in ConstraintInsetTarget and constraintOffsetTargetValue will be better? - #528

Open
guzhenhuaGitHub wants to merge 1 commit into
SnapKit:developfrom
guzhenhuaGitHub:develop
Open

use switch-case in ConstraintInsetTarget and constraintOffsetTargetValue will be better?#528
guzhenhuaGitHub wants to merge 1 commit into
SnapKit:developfrom
guzhenhuaGitHub:develop

Conversation

@guzhenhuaGitHub

@guzhenhuaGitHub guzhenhuaGitHub commented Aug 7, 2018

Copy link
Copy Markdown
Contributor

replace if-else with switch-case in ConstraintInsetTarget and constraintOffsetTargetValue
before:

if let amount = self as? Float {
...
} else if let amount = self as? Double {
...

change to:

switch self {
case let amount as Float:
...
case let amount as Double:
...
}

will that seems to be better?

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.

1 participant