Skip to content

Commit a0233fe

Browse files
committed
removed validation from Coordinate struct
1 parent b59eca1 commit a0233fe

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

src/PolylineAlgorithm/Coordinate.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ namespace PolylineAlgorithm;
1717
[DebuggerDisplay("{ToString()}")]
1818
[StructLayout(LayoutKind.Sequential, Pack = 8, Size = 16)]
1919
public readonly struct Coordinate : IEquatable<Coordinate> {
20-
private static readonly CoordinateRange _latitudeRange = new(-90, 90);
21-
private static readonly CoordinateRange _longitudeRange = new(-180, 180);
22-
2320
/// <summary>
2421
/// Initializes a new instance of the <see cref="Coordinate"/> struct with default values (0) for <see cref="Latitude"/> and <see cref="Longitude"/>.
2522
/// </summary>
@@ -38,14 +35,6 @@ public Coordinate() {
3835
/// or when <paramref name="longitude"/> is less than -180 or greater than 180.
3936
/// </exception>
4037
public Coordinate(double latitude, double longitude) {
41-
if(!_latitudeRange.IsInRange(latitude)) {
42-
throw new ArgumentOutOfRangeException(nameof(latitude), ""); // TODO: add message
43-
}
44-
45-
if (!_longitudeRange.IsInRange(longitude)) {
46-
throw new ArgumentOutOfRangeException(nameof(longitude), ""); // TODO: add message
47-
}
48-
4938
Latitude = latitude;
5039
Longitude = longitude;
5140
}

0 commit comments

Comments
 (0)