Skip to content

Commit 145e5ef

Browse files
committed
Merge branch 'develop' into 'master'
Code refactoring See merge request panache_team/ios/polyline!1
2 parents c309168 + 55d0949 commit 145e5ef

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Sources/Polyline/Polyline.swift

+7-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public func encode(path: [CLLocation]) -> Polyline {
1919
/// - Parameter path: A path to encode.
2020
///
2121
/// - Returns: The encode path as a `Polyline`.
22-
public func encode(path: [CLLocationCoordinate2D]) -> String {
22+
public func encode(path: [CLLocationCoordinate2D]) -> Polyline {
2323
var lastLat = 0, lastLng = 0
2424

2525
return path.reduce("", { result, point in
@@ -32,7 +32,12 @@ public func encode(path: [CLLocationCoordinate2D]) -> String {
3232
})
3333
}
3434

35-
private func encode(value: Int) -> String {
35+
/// Encode a value into a `Polyline`.
36+
///
37+
/// - Parameter value: The value to encode.
38+
///
39+
/// - Returns: A `Polyline`.
40+
private func encode(value: Int) -> Polyline {
3641
var result: String = ""
3742

3843
var v = value < 0 ? ~(value << 1) : value << 1

0 commit comments

Comments
 (0)