Skip to content

Commit b262ef1

Browse files
committed
code cleanup
1 parent 07be287 commit b262ef1

13 files changed

Lines changed: 12 additions & 19 deletions

File tree

samples/PolylineAlgorithm.NetTopologySuite.Sample/NetTopologyPolylineEncoder.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ namespace PolylineAlgorithm.NetTopologySuite.Sample;
77

88
using global::NetTopologySuite.Geometries;
99
using PolylineAlgorithm.Abstraction;
10-
using System.Buffers;
11-
using System.Text;
1210

1311
internal class NetTopologyPolylineEncoder : AbstractPolylineEncoder<Point, string> {
1412

src/PolylineAlgorithm.Abstraction/AbstractPolylineDecoder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ public IEnumerable<TCoordinate> Decode(TPolyline polyline) {
6262
int longitude = 0;
6363

6464
while (true) {
65-
if(sequence.Length == position) {
65+
if (sequence.Length == position) {
6666
break; // End of the polyline string
6767
}
6868

69-
if(!PolylineEncoding.TryReadValue(ref latitude, ref sequence, ref position)
69+
if (!PolylineEncoding.TryReadValue(ref latitude, ref sequence, ref position)
7070
|| !PolylineEncoding.TryReadValue(ref longitude, ref sequence, ref position)
7171
) {
7272
Options

src/PolylineAlgorithm.Abstraction/Internal/Logging.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal static partial class Logging {
1616

1717
[LoggerMessage(3, LogLevel.Error, "Internal buffer has {bufferLength} length. At position {position} is required additional {requiredSpace} length.")]
1818
internal static partial void LogInternalBufferOverflowError(this ILogger logger, int position, int bufferLength, int requiredSpace);
19-
19+
2020
[LoggerMessage(4, LogLevel.Error, "Cannot write to internal buffer at position {position}. Current coordinate index is {coordinateIndex}.")]
2121
internal static partial void LogCannotWriteValueToBufferError(this ILogger logger, int position, int coordinateIndex);
2222

src/PolylineAlgorithm/Coordinate.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ namespace PolylineAlgorithm;
77

88
using System;
99
using System.Diagnostics;
10-
using System.Diagnostics.CodeAnalysis;
1110
using System.Globalization;
1211
using System.Runtime.InteropServices;
1312

src/PolylineAlgorithm/PolylineDecoder.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
namespace PolylineAlgorithm;
77

88
using PolylineAlgorithm.Abstraction;
9-
using System.Buffers;
109
using System.Runtime.CompilerServices;
1110

1211
/// <summary>

src/PolylineAlgorithm/PolylineEncoder.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
namespace PolylineAlgorithm;
77

88
using PolylineAlgorithm.Abstraction;
9-
using System.Buffers;
109
using System.Runtime.CompilerServices;
1110

1211
/// <summary>

tests/PolylineAlgorithm.Abstraction.Tests/AbstractPolylineDecoderTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class AbstractPolylineDecoderTest {
1616

1717
public static IEnumerable<object[]> CoordinateCount => [[1], [10], [100], [1_000]];
1818

19-
public static IEnumerable<(double, double)> NotANumberAndInfinityCoordinates => StaticValueProvider.Invalid.GetNotANumberAndInfinityCoordinates() ;
19+
public static IEnumerable<(double, double)> NotANumberAndInfinityCoordinates => StaticValueProvider.Invalid.GetNotANumberAndInfinityCoordinates();
2020

2121
public static IEnumerable<(double, double)> MinAndMaxCoordinates => StaticValueProvider.Invalid.GetMinAndMaxCoordinates();
2222

tests/PolylineAlgorithm.Abstraction.Tests/AbstractPolylineEncoderTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class AbstractPolylineEncoderTest {
1515

1616
public static IEnumerable<object[]> CoordinateCount => [[1], [10], [100], [1_000]];
1717

18-
public static IEnumerable<(double, double)> NotANumberAndInfinityCoordinates => StaticValueProvider.Invalid.GetNotANumberAndInfinityCoordinates() ;
18+
public static IEnumerable<(double, double)> NotANumberAndInfinityCoordinates => StaticValueProvider.Invalid.GetNotANumberAndInfinityCoordinates();
1919

2020
public static IEnumerable<(double, double)> MinAndMaxCoordinates => StaticValueProvider.Invalid.GetMinAndMaxCoordinates();
2121

@@ -86,7 +86,7 @@ public void Encode_EmptyCoordinates_Throws_ArgumentException() {
8686
[TestMethod]
8787
public void Encode_BufferTooSmall_Throws_InternalBufferOverflowException() {
8888
// Arrange
89-
PolylineEncoder _encoder = new PolylineEncoder(new PolylineEncodingOptions { BufferSize = 12});
89+
PolylineEncoder _encoder = new PolylineEncoder(new PolylineEncodingOptions { BufferSize = 12 });
9090
IEnumerable<(double Latitude, double Longitude)> coordinates = RandomValueProvider.GetCoordinates(2);
9191

9292
// Act
@@ -100,7 +100,7 @@ public void Encode_BufferTooSmall_Throws_InternalBufferOverflowException() {
100100
[DynamicData(nameof(NotANumberAndInfinityCoordinates))]
101101
public void Encode_NotANumberAndInfinityCoordinate_Throws_ArgumentOutOfRangeException((double, double) coordinate) {
102102
// Arrange
103-
103+
104104
// Act
105105
var exception = Assert.ThrowsExactly<ArgumentOutOfRangeException>(() => _encoder.Encode([coordinate]));
106106

tests/PolylineAlgorithm.Abstraction.Tests/FakeLoggerFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public ILogger CreateLogger(string categoryName) {
2929
protected virtual void Dispose(bool disposing) {
3030
if (!_isDisposed) {
3131
if (disposing) {
32-
32+
3333
}
3434

3535
_isDisposed = true;

tests/PolylineAlgorithm.Abstraction.Tests/Internal/LoggingTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public void ILogger_LogPolylineCannotBeShorterThanError_Ok(string value) {
117117
_loggerProvider.Collector.LatestRecord.Message);
118118
}
119119

120-
120+
121121
[TestMethod]
122122
public void ILogger_LogRequestedBufferSizeExceedsMaxBufferLengthWarning_Ok() {
123123
// Arrange

0 commit comments

Comments
 (0)