Skip to content

Commit 19dc154

Browse files
committed
removed Debug.Asserrt
1 parent e1fc373 commit 19dc154

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

src/PolylineAlgorithm/Extensions/PolylineDecoderExtensions.cs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ public static class PolylineDecoderExtensions {
3030
/// Thrown when <paramref name="decoder"/> is <see langword="null"/>.
3131
/// </exception>
3232
public static IEnumerable<Coordinate> Decode(this IPolylineDecoder<Polyline, Coordinate> decoder, string polyline) {
33-
Debug.Assert(decoder is not null, "Decoder cannot be null.");
34-
3533
if (decoder is null) {
3634
throw new ArgumentNullException(nameof(decoder));
3735
}
@@ -55,18 +53,29 @@ public static IEnumerable<Coordinate> Decode(this IPolylineDecoder<Polyline, Coo
5553
/// Thrown when <paramref name="decoder"/> is <see langword="null"/>.
5654
/// </exception>
5755
public static IEnumerable<Coordinate> Decode(this IPolylineDecoder<Polyline, Coordinate> decoder, char[] polyline) {
58-
Debug.Assert(decoder is not null, "Decoder cannot be null.");
59-
6056
if (decoder is null) {
6157
throw new ArgumentNullException(nameof(decoder));
6258
}
6359

6460
return decoder.Decode(Polyline.FromCharArray(polyline));
6561
}
6662

63+
/// <summary>
64+
/// Decodes an encoded polyline represented as a read-only memory of characters into a sequence of geographic coordinates.
65+
/// </summary>
66+
/// <param name="decoder">
67+
/// The <see cref="IPolylineDecoder{TPolyline, TCoordinate}"/> instance used to perform the decoding operation.
68+
/// </param>
69+
/// <param name="polyline">
70+
/// The encoded polyline as a read-only memory of characters to decode.
71+
/// </param>
72+
/// <returns>
73+
/// An <see cref="IEnumerable{Coordinate}"/> containing the decoded latitude and longitude pairs.
74+
/// </returns>
75+
/// <exception cref="ArgumentNullException">
76+
/// Thrown when <paramref name="decoder"/> is <see langword="null"/>.
77+
/// </exception>
6778
public static IEnumerable<Coordinate> Decode(this IPolylineDecoder<Polyline, Coordinate> decoder, ReadOnlyMemory<char> polyline) {
68-
Debug.Assert(decoder is not null, "Decoder cannot be null.");
69-
7079
if (decoder is null) {
7180
throw new ArgumentNullException(nameof(decoder));
7281
}

src/PolylineAlgorithm/Extensions/PolylineEncoderExtensions.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ public static class PolylineEncoderExtensions {
3030
/// Thrown when <paramref name="encoder"/> is <see langword="null"/>.
3131
/// </exception>
3232
public static Polyline Encode(this IPolylineEncoder<Coordinate, Polyline> encoder, ICollection<Coordinate> coordinates) {
33-
Debug.Assert(encoder is not null, "Encoder cannot be null.");
34-
3533
if (encoder is null) {
3634
throw new ArgumentNullException(nameof(encoder));
3735
}
@@ -55,8 +53,6 @@ public static Polyline Encode(this IPolylineEncoder<Coordinate, Polyline> encode
5553
/// Thrown when <paramref name="encoder"/> is <see langword="null"/>.
5654
/// </exception>
5755
public static Polyline Encode(this IPolylineEncoder<Coordinate, Polyline> encoder, Coordinate[] coordinates) {
58-
Debug.Assert(encoder is not null, "Encoder cannot be null.");
59-
6056
if (encoder is null) {
6157
throw new ArgumentNullException(nameof(encoder));
6258
}

0 commit comments

Comments
 (0)