File tree Expand file tree Collapse file tree
src/PolylineAlgorithm.Abstraction Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,8 +56,8 @@ public TPolyline Encode(IEnumerable<TCoordinate> coordinates) {
5656 int consumed = 0 ;
5757 int length = count * Defaults . Polyline . MaxEncodedCoordinateLength ;
5858
59- if ( length > Options . GetMaxCharCount ( ) ) {
60- length = Options . GetMaxCharCount ( ) ;
59+ if ( length > Options . MaxCharCount ) {
60+ length = Options . MaxCharCount ;
6161 }
6262
6363 Span < char > buffer = stackalloc char [ length ] ;
Original file line number Diff line number Diff line change 55
66namespace PolylineAlgorithm . Abstraction ;
77
8- using PolylineAlgorithm . Abstraction . Internal ;
98using PolylineAlgorithm . Abstraction . Validation ;
109using PolylineAlgorithm . Abstraction . Validation . Abstraction ;
1110
@@ -19,26 +18,14 @@ public class PolylineEncodingOptions<TCoordinate> {
1918 /// </summary>
2019 public int MaxBufferSize { get ; } = 64_000 ;
2120
22- /// <summary>
23- /// Gets the validator used to validate coordinates, latitude, and longitude values.
24- /// </summary>
25- public Validator < TCoordinate > Validator { get ; } = new NullValidator < TCoordinate > ( ) ;
26-
2721 /// <summary>
2822 /// Gets the maximum number of characters that can be used in the encoding buffer.
2923 /// </summary>
3024 /// <returns>The maximum character count based on the buffer size.</returns>
31- internal int GetMaxCharCount ( ) => MaxBufferSize / sizeof ( char ) ;
25+ public int MaxCharCount => MaxBufferSize / sizeof ( char ) ;
3226
3327 /// <summary>
34- /// Validates the encoding options to ensure they are within acceptable limits .
28+ /// Gets the validator used to validate coordinates, latitude, and longitude values .
3529 /// </summary>
36- /// <exception cref="ArgumentException">
37- /// Thrown if <see cref="MaxBufferSize"/> is less than the minimum required buffer size.
38- /// </exception>
39- internal void Validate ( ) {
40- if ( MaxBufferSize < Defaults . Polyline . MaxEncodedCoordinateLength * sizeof ( char ) ) {
41- throw new ArgumentException ( ) ;
42- }
43- }
30+ public Validator < TCoordinate > Validator { get ; } = new NullValidator < TCoordinate > ( ) ;
4431}
You can’t perform that action at this time.
0 commit comments