@@ -20,7 +20,7 @@ public readonly struct ParallelExecutionSettings
2020 /// </summary>
2121 /// <param name="maxDegreeOfParallelism">
2222 /// The value used for initializing <see cref="ParallelOptions.MaxDegreeOfParallelism"/> when using TPL.
23- /// Set to <c>-1</c> to leave the degree of parallelism unbounded .
23+ /// If set to <c>-1</c>, there is no limit on the number of concurrently running operations .
2424 /// </param>
2525 /// <param name="minimumPixelsProcessedPerTask">The value for <see cref="MinimumPixelsProcessedPerTask"/>.</param>
2626 /// <param name="memoryAllocator">The <see cref="MemoryAllocator"/>.</param>
@@ -31,7 +31,7 @@ public ParallelExecutionSettings(
3131 {
3232 // Shall be compatible with ParallelOptions.MaxDegreeOfParallelism:
3333 // https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.paralleloptions.maxdegreeofparallelism
34- if ( maxDegreeOfParallelism == 0 || maxDegreeOfParallelism < - 1 )
34+ if ( maxDegreeOfParallelism is 0 or < - 1 )
3535 {
3636 throw new ArgumentOutOfRangeException ( nameof ( maxDegreeOfParallelism ) ) ;
3737 }
@@ -49,7 +49,7 @@ public ParallelExecutionSettings(
4949 /// </summary>
5050 /// <param name="maxDegreeOfParallelism">
5151 /// The value used for initializing <see cref="ParallelOptions.MaxDegreeOfParallelism"/> when using TPL.
52- /// Set to <c>-1</c> to leave the degree of parallelism unbounded .
52+ /// If set to <c>-1</c>, there is no limit on the number of concurrently running operations .
5353 /// </param>
5454 /// <param name="memoryAllocator">The <see cref="MemoryAllocator"/>.</param>
5555 public ParallelExecutionSettings ( int maxDegreeOfParallelism , MemoryAllocator memoryAllocator )
@@ -64,7 +64,7 @@ public ParallelExecutionSettings(int maxDegreeOfParallelism, MemoryAllocator mem
6464
6565 /// <summary>
6666 /// Gets the value used for initializing <see cref="ParallelOptions.MaxDegreeOfParallelism"/> when using TPL.
67- /// A value of <c>-1</c> leaves the degree of parallelism unbounded .
67+ /// A value of <c>-1</c> means there is no limit on the number of concurrently running operations .
6868 /// </summary>
6969 public int MaxDegreeOfParallelism { get ; }
7070
@@ -93,12 +93,10 @@ public ParallelExecutionSettings MultiplyMinimumPixelsPerTask(int multiplier)
9393 }
9494
9595 /// <summary>
96- /// Get the default <see cref="SixLabors.ImageSharp.Advanced. ParallelExecutionSettings"/> for a <see cref="SixLabors.ImageSharp. Configuration"/>
96+ /// Get the default <see cref="ParallelExecutionSettings"/> for a <see cref="Configuration"/>
9797 /// </summary>
9898 /// <param name="configuration">The <see cref="Configuration"/>.</param>
9999 /// <returns>The <see cref="ParallelExecutionSettings"/>.</returns>
100100 public static ParallelExecutionSettings FromConfiguration ( Configuration configuration )
101- {
102- return new ParallelExecutionSettings ( configuration . MaxDegreeOfParallelism , configuration . MemoryAllocator ) ;
103- }
101+ => new ( configuration . MaxDegreeOfParallelism , configuration . MemoryAllocator ) ;
104102}
0 commit comments