mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
join / -> reduce append
This commit is contained in:
committed by
Danny Mösch
parent
cd29a9aa50
commit
67973cb419
@@ -32,7 +32,9 @@ public struct Location: CustomStringConvertible, Comparable, Codable, Sendable {
|
||||
return file
|
||||
}
|
||||
|
||||
return fileComponents.dropFirst(baseComponents.count).joined(separator: "/")
|
||||
return fileComponents.dropFirst(baseComponents.count).reduce(into: URL(filePath: "")) {
|
||||
$0.append(component: $1)
|
||||
}.relativePath
|
||||
}
|
||||
|
||||
/// Creates a `Location` by specifying its properties directly.
|
||||
|
||||
Reference in New Issue
Block a user