Skip to content

Commit

Permalink
Refactor map to single line (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
tinder-cfuller authored Feb 23, 2024
1 parent 0a36026 commit 2d96c85
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions Sources/Layout/UIKit/UIView+AutoLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,7 @@ extension UIView {
multiplier: CGFloat = 1,
constant: CGFloat = 0
) -> [NSLayoutConstraint] {
attributes.map { attribute in
constraint(is: relation,
toSuperview: attribute,
multiplier: multiplier,
constant: constant)
}
attributes.map { constraint(is: relation, toSuperview: $0, multiplier: multiplier, constant: constant) }
}

/// Creates constraints defining the relationship between the given attributes of the receiver and target view.
Expand All @@ -293,13 +288,7 @@ extension UIView {
multiplier: CGFloat = 1,
constant: CGFloat = 0
) -> [NSLayoutConstraint] {
attributes.map { attribute in
constraint(is: relation,
to: attribute,
of: targetView,
multiplier: multiplier,
constant: constant)
}
attributes.map { constraint(is: relation, to: $0, of: targetView, multiplier: multiplier, constant: constant) }
}

// swiftlint:enable function_default_parameter_at_end
Expand Down

0 comments on commit 2d96c85

Please sign in to comment.