751 references to Min
http2cat (7)
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (1)
83int headCount = Math.Min(_buffer.Length - _removeIndex, _count);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
420int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 458int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\ServerInfrastructure\BufferWriter.cs (1)
145var writable = Math.Min(source.Length, _span.Length);
src\Shared\ServerInfrastructure\MemoryPoolExtensions.cs (1)
25return Math.Min(4096, pool.MaxBufferSize);
IIS.FunctionalTests (7)
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (1)
83int headCount = Math.Min(_buffer.Length - _removeIndex, _count);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
420int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 458int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\ServerInfrastructure\BufferWriter.cs (1)
145var writable = Math.Min(source.Length, _span.Length);
src\Shared\ServerInfrastructure\MemoryPoolExtensions.cs (1)
25return Math.Min(4096, pool.MaxBufferSize);
IIS.LongTests (7)
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (1)
83int headCount = Math.Min(_buffer.Length - _removeIndex, _count);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
420int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 458int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\ServerInfrastructure\BufferWriter.cs (1)
145var writable = Math.Min(source.Length, _span.Length);
src\Shared\ServerInfrastructure\MemoryPoolExtensions.cs (1)
25return Math.Min(4096, pool.MaxBufferSize);
IIS.NewHandler.FunctionalTests (7)
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (1)
83int headCount = Math.Min(_buffer.Length - _removeIndex, _count);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
420int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 458int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\ServerInfrastructure\BufferWriter.cs (1)
145var writable = Math.Min(source.Length, _span.Length);
src\Shared\ServerInfrastructure\MemoryPoolExtensions.cs (1)
25return Math.Min(4096, pool.MaxBufferSize);
IIS.NewShim.FunctionalTests (7)
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (1)
83int headCount = Math.Min(_buffer.Length - _removeIndex, _count);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
420int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 458int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\ServerInfrastructure\BufferWriter.cs (1)
145var writable = Math.Min(source.Length, _span.Length);
src\Shared\ServerInfrastructure\MemoryPoolExtensions.cs (1)
25return Math.Min(4096, pool.MaxBufferSize);
IIS.ShadowCopy.Tests (2)
src\Shared\ServerInfrastructure\BufferWriter.cs (1)
145var writable = Math.Min(source.Length, _span.Length);
src\Shared\ServerInfrastructure\MemoryPoolExtensions.cs (1)
25return Math.Min(4096, pool.MaxBufferSize);
IISExpress.FunctionalTests (7)
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (1)
83int headCount = Math.Min(_buffer.Length - _removeIndex, _count);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
420int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 458int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\ServerInfrastructure\BufferWriter.cs (1)
145var writable = Math.Min(source.Length, _span.Length);
src\Shared\ServerInfrastructure\MemoryPoolExtensions.cs (1)
25return Math.Min(4096, pool.MaxBufferSize);
InMemory.FunctionalTests (1)
src\Servers\Kestrel\shared\test\StringExtensions.cs (1)
15return s.Substring(0, Math.Min(128, s.Length))
Microsoft.Arcade.Test.Common (2)
DiffUtil.cs (2)
263d[i, j] = Math.Min(Math.Min(m1, m2), m3);
Microsoft.AspNetCore.App.Analyzers (1)
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxNode.cs (1)
102start = Math.Min(token.VirtualChars[0].Span.Start, start);
Microsoft.AspNetCore.Authentication.Cookies (1)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
206var length = Math.Min(dataSizePerCookie, remainingLength);
Microsoft.AspNetCore.Components.QuickGrid (1)
QuickGrid.razor.cs (1)
340count = Math.Min(request.Count, Pagination.ItemsPerPage - request.StartIndex);
Microsoft.AspNetCore.Components.Server (3)
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\BufferWriter.cs (1)
239var writable = Math.Min(bytesLeftToCopy, _span.Length);
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackReader.cs (1)
1109int bytesRead = Math.Min(remainingByteLength, this.reader.UnreadSpan.Length);
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReader.cs (1)
484int toCopy = Math.Min(nextSpan.Length, destination.Length - copied);
Microsoft.AspNetCore.Components.Web (2)
Virtualization\Virtualize.cs (2)
210var lastItemIndex = Math.Min(_itemsBefore + _visibleItemCapacity, _itemCount); 212var placeholdersBeforeCount = Math.Min(_loadedItemsStartIndex, lastItemIndex);
Microsoft.AspNetCore.CookiePolicy.Test (1)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
206var length = Math.Min(dataSizePerCookie, remainingLength);
Microsoft.AspNetCore.Cryptography.KeyDerivation (1)
PBKDF2\ManagedPbkdf2Provider.cs (1)
58int numBytesToCopy = Math.Min(numBytesRemaining, T_blockIndex.Length);
Microsoft.AspNetCore.DataProtection (1)
SP800_108\ManagedSP800_108_CTR_HMACSHA512.cs (1)
47var numBytesToCopyThisIteration = Math.Min(prfOutputSizeInBytes, outputCount);
Microsoft.AspNetCore.Http.Connections.Tests (1)
TestWebSocketConnectionFeature.cs (1)
155length = Math.Min(buffer.Count - buffer.Offset, _internalBuffer.Buffer.Length);
Microsoft.AspNetCore.Http.Tests (1)
Features\FormFeatureTests.cs (1)
620var toWrite = Math.Min(size - written, bytes.Length);
Microsoft.AspNetCore.HttpLogging (3)
BufferingStream.cs (1)
186var adjustedToMaximumSize = Math.Min(maxBufferSize, sizeHint);
RequestBufferingStream.cs (1)
94var innerCount = Math.Min(remaining, span.Length);
ResponseBufferingStream.cs (1)
85var innerCount = Math.Min(remaining, span.Length);
Microsoft.AspNetCore.Identity.FunctionalTests (1)
src\Identity\Extensions.Core\src\Base32.cs (1)
96var bits = Math.Min(5 - bitIndex, 8 - outputBits);
Microsoft.AspNetCore.Mvc.Core (1)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
206var length = Math.Min(dataSizePerCookie, remainingLength);
Microsoft.AspNetCore.Mvc.TagHelpers (1)
CacheTagHelper.cs (1)
264var pageLength = Math.Min(length, page.Length);
Microsoft.AspNetCore.Mvc.ViewFeatures (3)
Buffers\PagedBufferedTextWriter.cs (1)
57var pageLength = Math.Min(length, page.Length);
Buffers\PagedCharBuffer.cs (2)
60var copyLength = Math.Min(count, page.Length - _charIndex); 81var copyLength = Math.Min(count, page.Length - _charIndex);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
DefaultHtmlGeneratorTest.cs (1)
281Assert.Equal(Math.Min(ModelWithMaxLengthMetadata.MaxLengthAttributeValue, ModelWithMaxLengthMetadata.StringLengthAttributeValue), int.Parse(attribute.Value, CultureInfo.InvariantCulture));
Microsoft.AspNetCore.OutputCaching (1)
RecyclableSequenceBuilder.cs (1)
100var toWrite = Math.Min(buffer.Length, available.Length);
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (4)
EndToEndBenchmarks.cs (4)
83var bytes = Math.Min(rand.Next(4, 1024), value.Length); 96var bytes = Math.Min(rand.Next(4, 1024), value.Length); 98bytes = Math.Min(bytes, span.Length); 111var bytes = Math.Min(rand.Next(4, 1024), value.Length);
Microsoft.AspNetCore.ResponseCaching (1)
src\Shared\SegmentWriteStream.cs (1)
144var bytesWritten = Math.Min(buffer.Length, _segmentSize - (int)_bufferStream.Length);
Microsoft.AspNetCore.Routing.Microbenchmarks (1)
Matching\JumpTableMultipleEntryBenchmark.cs (1)
156var text = guid.Substring(0, Math.Max(5, Math.Min(i, 36)));
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (7)
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (1)
83int headCount = Math.Min(_buffer.Length - _removeIndex, _count);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
420int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 458int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\ServerInfrastructure\BufferWriter.cs (1)
145var writable = Math.Min(source.Length, _span.Length);
src\Shared\ServerInfrastructure\MemoryPoolExtensions.cs (1)
25return Math.Min(4096, pool.MaxBufferSize);
Microsoft.AspNetCore.Server.IIS (2)
src\Shared\ServerInfrastructure\BufferWriter.cs (1)
145var writable = Math.Min(source.Length, _span.Length);
src\Shared\ServerInfrastructure\MemoryPoolExtensions.cs (1)
25return Math.Min(4096, pool.MaxBufferSize);
Microsoft.AspNetCore.Server.Kestrel.Core (12)
Internal\Http2\Http2Connection.cs (1)
170StreamPool = new PooledStreamStack<Http2Stream>(Math.Min(InitialStreamPoolSize, http2Limits.MaxStreamsPerConnection));
Internal\Infrastructure\HttpUtilities.cs (1)
165for (var i = 0; i < Math.Min(span.Length, maxChars); i++)
Internal\Infrastructure\PipeWriterHelpers\ConcurrentPipeWriter.cs (1)
389var adjustedToMaximumSize = Math.Min(maxBufferSize, sizeHint);
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (1)
83int headCount = Math.Min(_buffer.Length - _removeIndex, _count);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
420int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 458int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http3\QPack\QPackDecoder.cs (2)
287int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 373int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex);
src\Shared\ServerInfrastructure\BufferWriter.cs (1)
145var writable = Math.Min(source.Length, _span.Length);
src\Shared\ServerInfrastructure\MemoryPoolExtensions.cs (1)
25return Math.Min(4096, pool.MaxBufferSize);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (4)
CertificatePathWatcherTests.cs (1)
100Assert.Equal(Math.Min(dirCount, fileCount), watcher.TestGetDirectoryWatchCountUnsynchronized());
src\Servers\Kestrel\shared\test\StringExtensions.cs (1)
15return s.Substring(0, Math.Min(128, s.Length))
src\Shared\test\Shared.Tests\runtime\Http2\DynamicTableTest.cs (1)
172int expectedCount = Math.Min(finalMaxSize / 64, headers.Count);
src\Shared\test\Shared.Tests\runtime\Http3\QPackDecoderTest.cs (1)
343int resolvedSize = Math.Min(encoded.Length - i, chunkSize);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
SchedulerBenchmark.cs (1)
20private static readonly int IOQueueCount = Math.Min(Environment.ProcessorCount, 16);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
NamedPipeTransportOptions.cs (1)
20public int ListenerQueueCount { get; set; } = Math.Min(Environment.ProcessorCount, 16);
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (2)
SocketConnectionFactoryOptions.cs (1)
38public int IOQueueCount { get; set; } = Math.Min(Environment.ProcessorCount, 16);
SocketTransportOptions.cs (1)
33public int IOQueueCount { get; set; } = Math.Min(Environment.ProcessorCount, 16);
Microsoft.AspNetCore.Shared.Tests (15)
runtime\Http2\DynamicTableTest.cs (1)
172int expectedCount = Math.Min(finalMaxSize / 64, headers.Count);
runtime\Http3\QPackDecoderTest.cs (1)
343int resolvedSize = Math.Min(encoded.Length - i, chunkSize);
SegmentWriteStreamTests.cs (3)
60var expectedSegmentSize = Math.Min(segmentSize, WriteData.Length - i); 84stream.Write(WriteData, i, Math.Min(writeSize, WriteData.Length - i)); 93var expectedSegmentSize = Math.Min(segmentSize, WriteData.Length - i);
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (1)
83int headCount = Math.Min(_buffer.Length - _removeIndex, _count);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (4)
420int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 458int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http3\QPack\QPackDecoder.cs (2)
287int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 373int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex);
src\Shared\SegmentWriteStream.cs (1)
144var bytesWritten = Math.Min(buffer.Length, _segmentSize - (int)_bufferStream.Length);
src\Shared\ServerInfrastructure\BufferWriter.cs (1)
145var writable = Math.Min(source.Length, _span.Length);
src\Shared\ServerInfrastructure\MemoryPoolExtensions.cs (1)
25return Math.Min(4096, pool.MaxBufferSize);
Microsoft.AspNetCore.TestHost (1)
TestWebSocket.cs (1)
141int count = Math.Min(buffer.Count, receiveMessage.Buffer.Count);
Microsoft.AspNetCore.WebSockets (1)
HandshakeHelpers.cs (1)
206parsedOptions.ServerMaxWindowBits = Math.Min(parsedServerMaxWindowBits ?? 15, serverMaxWindowBits);
Microsoft.AspNetCore.WebSockets.Tests (2)
BufferStream.cs (2)
133int actualCount = Math.Min(count, _topBuffer.Count); 197var actualCount = Math.Min(count, _topBuffer.Count);
Microsoft.AspNetCore.WebUtilities (14)
BufferedReadStream.cs (2)
209int toCopy = Math.Min(_bufferCount, count); 231int toCopy = Math.Min(_bufferCount, buffer.Length);
FileBufferingReadStream.cs (2)
284var rentedBuffer = _bytePool.Rent(Math.Min((int)oldBuffer.Length, _maxRentedBufferSize)); 359var rentedBuffer = _bytePool.Rent(Math.Min((int)oldBuffer.Length, _maxRentedBufferSize));
HttpResponseStreamWriter.cs (3)
629var remaining = Math.Min(_charBufferSize - _charBufferCount, count); 644var remaining = Math.Min(_charBufferSize - _charBufferCount, count); 660var remaining = Math.Min(_charBufferSize - _charBufferCount, value.Length);
MultipartReaderStream.cs (6)
177var slice = buffer.AsSpan(0, Math.Min(buffer.Length, index)); 197read = _innerStream.Read(buffer, offset, Math.Min(count, matchOffset - bufferedData.Offset)); 208read = _innerStream.Read(buffer, offset, Math.Min(count, bufferedData.Count)); 257var slice = buffer[..Math.Min(buffer.Length, index)]; 280var slice = buffer[..Math.Min(buffer.Length, matchOffset - bufferedData.Offset)]; 294read = _innerStream.Read(buffer.Span[..Math.Min(buffer.Length, bufferedData.Count)]);
PagedByteBuffer.cs (1)
53var copyLength = Math.Min(memory.Length, currentPage.Length - _currentPageIndex);
Microsoft.Build (15)
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (2)
778int lengthToWrite = Math.Min(writeStreamLength - i, MaxPacketWriteSize); 856delay = Math.Min(delay * 2, 500);
BackEnd\Components\RequestBuilder\TaskHost.cs (1)
874coresBeingReleased = Math.Min(coresBeingReleased, _additionalAcquiredCores);
BackEnd\Components\Scheduler\Scheduler.cs (3)
585int grantedCores = Math.Min(requestedCores, availableCores); 1553inProcNodesToCreate = Math.Min(availableNodesWithInProcAffinity, inProcNodesToCreate); 1585outOfProcNodesToCreate = Math.Min(maxCreatableOutOfProcNodes, outOfProcNodesToCreate);
BackEnd\Components\Scheduler\SchedulingData.cs (1)
680coresToRemove = Math.Min(request.GrantedCores, coresToRemove);
Definition\Project.cs (2)
2978string displayValue = escapedValue.Substring(0, Math.Min(escapedValue.Length, 75)) + ((escapedValue.Length > 75) ? "..." : String.Empty); 2985string displayOriginalValue = originalValue.Substring(0, Math.Min(originalValue.Length, 75)) + ((originalValue.Length > 75) ? "..." : String.Empty);
FileMatcher.cs (2)
999dop = Math.Min(taskOptions.MaxTasksPerIteration, taskOptions.AvailableTasks); 2537int compareLength = Math.Min(
Logging\BinaryLogger\Postprocessing\SubStream.cs (1)
46count = Math.Min((int)Math.Max(Length - _position, 0), count);
Logging\LogFormatter.cs (1)
53int prettyLength = System.Math.Min(11, rawTimeLength);
Logging\ParallelLogger\ConsoleOutputAligner.cs (1)
110int remainingCharsToEndOfBuffer = Math.Min(bufferWidthMinusNewLine - cursor, count - endIndex);
StringExtensions.cs (1)
62int length = Math.Min(span.Length, other.Length);
Microsoft.Build.Engine (1)
Logging\LogFormatter.cs (1)
53int prettyLength = System.Math.Min(11, rawTimeLength);
Microsoft.Build.Framework (10)
SegmentedArray.cs (10)
488var currentSegmentLength = Math.Min(remainingInSegment, _length); 497var currentSegmentLength = Math.Min(SegmentedArrayHelper.GetSegmentSize<T>(), _length - _completed); 592var currentSegmentLength = Math.Min(Math.Min(remainingInFirstSegment, remainingInSecondSegment), _length - _completed); 640var currentSegmentLength = Math.Min(Math.Min(remainingInFirstSegment, remainingInSecondSegment), _length - _completed); 730_current = segment.AsMemory().Slice(offset, Math.Min(remainingInSegment, _length)); 737_current = segment.AsMemory().Slice(0, Math.Min(SegmentedArrayHelper.GetSegmentSize<T>(), _length - _completed)); 779_current = segment.AsMemory().Slice(offset, Math.Min(remainingInSegment, _length)); 786_current = segment.AsMemory().Slice(0, Math.Min(SegmentedArrayHelper.GetSegmentSize<T>(), _length - _completed));
Microsoft.Build.Tasks.Core (6)
FileMatcher.cs (2)
999dop = Math.Min(taskOptions.MaxTasksPerIteration, taskOptions.AvailableTasks); 2537int compareLength = Math.Min(
GenerateResource.cs (2)
736int maxCount = Math.Min(inputsToProcess.Count, outputsToProcess.Count); 737maxCount = Math.Min(maxCount, 5); // Limit to just 5
Hash.cs (1)
86int charsToProcess = Math.Min(itemSpec.Length - itemSpecPosition, MaxInputChunkLength);
StreamMappedString.cs (1)
388charactersExtracted = Math.Min(length - i, charactersOnPage - relativeStartPosition);
Microsoft.Build.UnitTests.Shared (2)
ObjectModelHelpers.cs (2)
288int minimumLength = Math.Min(expectedItems.Length, items.Count); 1936for (int i = 0; i < Math.Min(actualLines.Length, expectedLines.Length); i++)
Microsoft.Build.Utilities.Core (2)
FileMatcher.cs (2)
999dop = Math.Min(taskOptions.MaxTasksPerIteration, taskOptions.AvailableTasks); 2537int compareLength = Math.Min(
Microsoft.DotNet.Build.Tasks.Feed (1)
src\common\GeneralUtils.cs (1)
79int minBytesAvailable = Math.Min(bytesLocalAvailable, bytesRemoteAvailable);
Microsoft.DotNet.NuGetRepack.Tests (2)
TestHelpers\DiffUtil.cs (2)
263d[i, j] = Math.Min(Math.Min(m1, m2), m3);
Microsoft.DotNet.SignTool (2)
src\Hash.cs (1)
76var maxSize = Math.Min(maxItemsToHash, values.Length);
src\SignToolTask.cs (1)
324int min = Math.Min(dir1.Length, dir2.Length);
Microsoft.DotNet.VersionTools (1)
src\Dependencies\Submodule\SubmoduleDependencyInfo.cs (1)
97public string SimpleVersion => Commit?.Substring(0, Math.Min(7, Commit.Length)) ?? "latest";
Microsoft.Extensions.DependencyInjection (2)
DependencyInjectionEventSource.cs (2)
118format.Substring(i * MaxChunkSize, Math.Min(MaxChunkSize, format.Length - i * MaxChunkSize)), i, chunkCount, 233descriptorString.Substring(i * MaxChunkSize, Math.Min(MaxChunkSize, descriptorString.Length - i * MaxChunkSize)), i, chunkCount);
Microsoft.Extensions.Identity.Core (1)
Base32.cs (1)
96var bits = Math.Min(5 - bitIndex, 8 - outputBits);
Microsoft.Interop.SourceGeneration (2)
SyntaxExtensions.cs (1)
114(_, _) => Math.Min(idxPartial, idxRef)
TypeSymbolExtensions.cs (1)
278int numArgumentsToCopy = Math.Min(numArgumentsToInsert, typeArgumentsToSubstitute.Length - currentArityOffset);
Microsoft.NET.WebAssembly.Webcil (1)
WebcilConverter.cs (1)
150firstPESection = Math.Min(firstPESection.Position, sectionHeader.PointerToRawData);
Microsoft.VisualBasic.Core (3)
Microsoft\VisualBasic\CompilerServices\VBBinder.vb (2)
1164For ParmIndex = 0 To Math.Min(LastArgIndexToCheck, ParamArrayIndex) - 1 1313For ParmIndex = 0 To Math.Min(ArgCountUpperBound, Math.Max(LastNonSetValueIndex0, LastNonSetValueIndex1))
Microsoft\VisualBasic\ErrObject.vb (1)
113ElseIf System.String.CompareOrdinal("Exception from HRESULT: 0x", 0, Msg, 0, Math.Min(Msg.Length, 26)) = 0 Then
MonoAOTCompiler (1)
MonoAOTCompiler.cs (1)
526int allowedParallelism = DisableParallelAot ? 1 : Math.Min(_assembliesToCompile.Count, Environment.ProcessorCount);
MonoTargetsTasks (3)
EmitBundleTask\EmitBundleBase.cs (2)
156int allowedParallelism = Math.Max(Math.Min(bundledResources.Count, Environment.ProcessorCount), 1); 469: encodedHash.Substring(0, Math.Min(encodedHash.Length, maxEncodedHashLength));
ILStrip\ILStrip.cs (1)
77int allowedParallelism = DisableParallelStripping ? 1 : Math.Min(Assemblies.Length, Environment.ProcessorCount);
MSBuild (3)
TerminalLogger\NodesFrame.cs (1)
29Width = Math.Min(width, MaxColumn);
TerminalLogger\Terminal.cs (1)
156ReadOnlySpan<char> truncatedText = text.Slice(0, Math.Min(text.Length, Width - 1));
TerminalLogger\TerminalLogger.cs (1)
1217int length = Math.Min(maxLength - indent.Length, text.Length - start);
MSBuildTaskHost (1)
Concurrent\ConcurrentQueue.cs (1)
112int nextSize = tail._preservedForObservation != 0 ? InitialSegmentLength : Math.Min(tail.Capacity * 2, MaxSegmentLength);
PresentationBuildTasks (3)
MS\Internal\MarkupCompiler\VersionHelper.cs (1)
205int build = Math.Min(ushort.MaxValue, (int)days.TotalDays);
src\Microsoft.DotNet.Wpf\src\PresentationCore\System\Windows\Media\ParsersCommon.cs (2)
377_curIndex = Math.Min(_curIndex+8, _pathLength); // "Infinity" has 8 characters 387_curIndex = Math.Min(_curIndex+3, _pathLength); // "NaN" has 3 characters
PresentationCore (58)
MS\Internal\FontCache\FontCacheUtil.cs (1)
742int minLength = Math.Min(aLength, bLength);
MS\Internal\FontCache\FontFaceLayoutInfo.cs (1)
931int smaller = Math.Min(lastChar, firstChar);
MS\Internal\Generic\Span.cs (1)
510_cp = Math.Min(cp, _dcp);
MS\Internal\IListConverters.cs (4)
108List<double> list = new List<double>(Math.Min(256, value.Length / EstimatedCharCountPerItem + 1)); 151List<ushort> list = new List<ushort>(Math.Min(256, value.Length / EstimatedCharCountPerItem + 1)); 192List<bool> list = new List<bool>(Math.Min(256, value.Length / EstimatedCharCountPerItem + 1)); 234List<Point> list = new List<Point>(Math.Min(256, value.Length / EstimatedCharCountPerItem + 1));
MS\Internal\Ink\Renderer.cs (1)
569i = Math.Min(_visuals.Count, _strokes.Count); //not -1, we're about to decrement
MS\Internal\IO\Packaging\NetStream.cs (2)
152count = Math.Min(bytesAvailable, count); // don't return more than they requested, and don't return more than is available 740bytesAvailable = Math.Min(block.Length, (int)(data.End - block.Offset));
MS\Internal\Shaping\TypefaceMap.cs (4)
185cch = Math.Min(cch, itemSpanRider.Length); 186cch = Math.Min(cch, typefaceIndexSpanRider.Length); 230int cch = Math.Min(cchRange - ich, typefaceIndexSpanRider.Length); 396int cch = Math.Min(unicodeString.Length - ich, typefaceSpanRider.Length);
MS\Internal\TextFormatting\Bidi.cs (3)
1615((Math.Min(startOfNeutrals, startOfDelayed) == PositionInvalid) ? 1617(Math.Min(startOfNeutrals, startOfDelayed))); 1847cchText = Math.Min(cchText, index);
MS\Internal\TextFormatting\FormatSettings.cs (1)
179formatWidth = Math.Min(formatWidth, Constants.IdealInfiniteWidth);
MS\Internal\TextFormatting\FullTextLine.cs (5)
1384offsetToNextCaretStopIndex = Math.Min(Length, lsrun.Length - caretStopIndex + lsrun.OffsetToFirstCp + _cpFirst); 1426lscpVisisble = Math.Min(lscpVisisble, _metrics._lscpLim - 1); 1658int lscpEndInSubline = Math.Min( 2001int cch = Math.Min(plsrunSpanRider.Length, cchLeft); 2087cch = Math.Min(cch, cchLeft);
MS\Internal\TextFormatting\FullTextState.cs (1)
272return Math.Min(0, TextFormatterImp.RealToIdeal(_markerStore.Pap.TextMarkerProperties.Offset) - _store.Settings.TextIndent);
MS\Internal\TextFormatting\LexicalChunk.cs (2)
86return ich - cchLast + Math.Min(cchLast, lsdcp - lsdcpLast); 94return ich - cchLast + Math.Min(cchLast, lsdcp - lsdcpLast);
MS\Internal\TextFormatting\SimpleTextLine.cs (2)
854int afterLast = Math.Min(ich + run.Length, dcp + textLength) + _cpFirst; 1253cpVisible = Math.Min(cpRunEnd, cp);
MS\Internal\TextFormatting\TextMarkerSource.cs (1)
184Math.Min(_characterArray.Length, textSourceCharacterIndexLimit)
MS\Internal\TextFormatting\TextRunCacheImp.cs (2)
229int lookAheadLimit = Math.Min(runLength, looseCharLength + TextStore.TypicalCharactersPerLine); 255looseCharLength = Math.Min(runLength, endOffset);
MS\Internal\TextFormatting\TextStore.cs (6)
525int effectedRangeEnd = Math.Min(cpFetched - offset + runInfo.Length, bounds[bounds.Length - 1].Position); 535int currentRangeEnd = Math.Min(bounds[i].Position, effectedRangeEnd); 1137int runLength = Math.Min(span.length, cchToAdd - ichRun); 1225int first = limit - Math.Min(charRange.Length, limitCp - firstCp); 1308int spanLength = Math.Min(runInfoSpanRider.Length, textEffectsSpanRider.Length); 1309int ichEnd = Math.Min(ichRun + spanLength, cchUniform);
System\Windows\dataobject.cs (1)
2348_current = _current + (int)Math.Min(celt, Int32.MaxValue - _current);
System\Windows\Media\ArcSegment.cs (1)
104count = Math.Min(count, 4);
System\Windows\Media\FormattedText.cs (13)
344i = Math.Min(limit, i + formatRider.Length); 418i = Math.Min(limit, i + formatRider.Length); 473i = Math.Min(limit, i + formatRider.Length); 526i = Math.Min(limit, i + formatRider.Length); 585i = Math.Min(limit, i + formatRider.Length); 644i = Math.Min(limit, i + formatRider.Length); 696i = Math.Min(limit, i + formatRider.Length); 749i = Math.Min(limit, i + formatRider.Length); 802i = Math.Min(limit, i + formatRider.Length); 854i = Math.Min(limit, i + formatRider.Length); 995return _that._maxTextWidths[Math.Min(line, _that._maxTextWidths.Length - 1)]; 1139Math.Min(textSourcePosition + line.Length - 1, _that._text.Length - 1) 1651int x1 = Math.Min(enumerator.Position + enumerator.Length, startIndex + count);
System\Windows\Media\GlyphsSerializer.cs (1)
294lastCaretStop = Math.Min(i | 3, _caretStops.Count - 1);
System\Windows\Media\Imaging\BitmapPalette.cs (1)
285int numColors = Math.Min(256, _colors.Count);
System\Windows\Media\MediaContext.cs (1)
823_animationRenderRate = Math.Min(_animationRenderRate, 1000);
System\Windows\Media\ParsersCommon.cs (2)
377_curIndex = Math.Min(_curIndex+8, _pathLength); // "Infinity" has 8 characters 387_curIndex = Math.Min(_curIndex+3, _pathLength); // "NaN" has 3 characters
System\Windows\Media\VisualProxy.cs (1)
580Array.Copy(_tail, reallocatedTail, Math.Min(_tail.Length, newLength));
PresentationFramework (129)
MS\Internal\Data\RBTree.cs (1)
398int n = Math.Min(mid - left, right - mid);
MS\Internal\Documents\DocumentGrid.cs (2)
2234maxColumns = Math.Min(maxColumns, _pageCache.PageCount); 2235maxColumns = Math.Min(maxColumns, DocumentViewerConstants.MaximumMaxPagesAcross);
MS\Internal\Documents\IFlowDocumentViewer.cs (1)
842GoToPage(Math.Min(PageCount, MasterPageNumber + 2));
MS\Internal\Documents\RowCache.cs (1)
542_layoutColumns = Math.Min(_layoutColumns, PageCache.PageCount);
MS\Internal\Documents\TextBoxLine.cs (1)
124int runLength = Math.Min(128, position.GetTextRunLength(LogicalDirection.Backward));
MS\Internal\Documents\TextBoxView.cs (12)
697int startOffset = Math.Min(_lineMetrics[_lineMetrics.Count - 1].EndOffset, startPosition.Offset); 698int endOffset = Math.Min(_lineMetrics[_lineMetrics.Count - 1].EndOffset, endPosition.Offset); 706lastLineIndex = Math.Min(lastLineIndex, GetLineIndexFromOffset(endOffset, LogicalDirection.Backward)); 775int nextLineIndex = Math.Max(0, Math.Min(_lineMetrics.Count - 1, lineIndex + count)); 1938int endOffset = Math.Min(range.StartIndex + range.PositionsAdded, _host.TextContainer.SymbolCount); 2050int endOffset = Math.Min(_lineMetrics[lineIndex].EndOffset, unclippedEndOffset); 2146int endOffset = Math.Min(lineEndOffset, unclippedEndOffset); 2208firstLineIndex = Math.Max(0, Math.Min(firstLineIndex, _lineMetrics.Count - 1)); 2209lastLineIndex = Math.Max(0, Math.Min(lastLineIndex, _lineMetrics.Count - 1)); 2715int lineCount = Math.Min(oldLastLineIndex, firstLineIndex + count - 1) - lineIndex + 1; 2815count = Math.Min(count, _viewportLineVisuals.Count - start); 2994int rangeSize = Math.Min(viewportEnd, selectionEnd) - rangeStart;
MS\Internal\Documents\TextContainerHelper.cs (3)
202_cpFirst = Math.Min(_cpFirst, cpFirst); 227_ranges[i * 2] = Math.Min(_ranges[i * 2], cpFirst); 475int depth = Math.Min(ancestorsStart.Count, ancestorsEnd.Count);
MS\Internal\Documents\TextParagraphView.cs (2)
168lineIndex = Math.Min(lines.Count - 1, lineIndex); 578lineIndex = Math.Max(Math.Min((int)(point.Y / approximatedLineHeight), lines.Count - 1), 0);
MS\Internal\Globalization\LocalizableResourceBuilder.cs (2)
576Readability readability = (Readability)Math.Min( 582Modifiability modifiability = (Modifiability)Math.Min(
MS\Internal\PtsHost\ContainerParagraph.cs (5)
528fsrcToFillSubtrack.u = Math.Max(Math.Min(fsrcToFillSubtrack.u, fsrcToFill.u + fsrcToFill.du - 1), fsrcToFill.u); 542fsrcToFillSubtrack.v = Math.Max(Math.Min(fsrcToFillSubtrack.v, fsrcToFill.v + fsrcToFill.dv - 1), fsrcToFill.v); 603dvrUsed = Math.Min(fsrcToFill.dv, dvrUsed); 686urSubtrack = Math.Max(Math.Min(urTrack + mbp.MBPLeft, urTrack + durTrack - 1), urTrack); 816urSubtrack = Math.Max(Math.Min(urTrack + mbp.MBPLeft, urTrack + durTrack - 1), urTrack);
MS\Internal\PtsHost\DtrList.cs (2)
104int adjust = Math.Min(_dtrs[i].PositionsAdded, dtr.PositionsRemoved - delta); 118int adjust = Math.Min(dtr.PositionsRemoved, _dtrs[i].PositionsAdded - delta);
MS\Internal\PtsHost\FloaterParagraph.cs (2)
216dvrAvailable = Math.Min(dvrAvailable, PTS.dvBottomUndefined / 2); 222dvrAvailable = Math.Min(dvrAvailable, TextDpi.ToTextDpi(StructuralCache.CurrentFormatContext.PageHeight));
MS\Internal\PtsHost\MarginCollapsingState.cs (1)
168_minNegative = Math.Min(_minNegative, mcs._minNegative);
MS\Internal\PtsHost\PtsHelper.cs (1)
838return Math.Max(1, Math.Min(PTS.Restrictions.tscColumnRestriction-1, columns)); // at least 1 column is required
MS\Internal\PtsHost\PtsHost.cs (1)
1532for(int breakIndex = 0; breakIndex < Math.Min(textBreakpoints.Count, nLineVariantsAlloc); breakIndex++)
MS\Internal\PtsHost\TableParaClient.cs (3)
652int du = Math.Min(Math.Abs(rect.u - u), Math.Abs(rect.u + rect.du - u)); 653int dv = Math.Min(Math.Abs(rect.v - v), Math.Abs(rect.v + rect.dv - v)); 1934Math.Min(_calculatedColumns.Length, columns));
MS\Internal\PtsHost\TextParaClient.cs (8)
749int dcpEnd = Math.Min(cpEndTextPointer, cpParagraphEnd) - cpParagraphStart; 1414int countVisualsShiftBeforeChange = Math.Min(Math.Max(lineIndexToBeginRemoval - _lineIndexFirstVisual, 0), lineVisuals.Count); 1431int actualLinesToRemove = Math.Min(Math.Max(lineIndexToBeginRemoval - _lineIndexFirstVisual + cLinesToRemove, 0), lineVisuals.Count); 1459int actualLinesToRemove = Math.Min(cLinesToRemove, lineVisuals.Count - (lineIndexToBeginRemoval - _lineIndexFirstVisual)); 1882int cchRangeForThisLine = Math.Max(Math.Min(lineDesc.dcpLim, dcpEnd) - dcpRangeStartForThisLine, 1); 1992int cchRangeForThisElem = Math.Max(Math.Min(elemDesc.dcpLim, dcpEnd) - dcpRangeStartForThisElem, 1); 3133line.GetGlyphRuns(glyphRuns, Math.Max(dcpStart, lineDesc.dcpFirst), Math.Min(dcpEnd, lineDesc.dcpLim)); 3195line.GetGlyphRuns(glyphRuns, Math.Max(dcpStart, element.dcpFirst), Math.Min(dcpEnd, element.dcpLim));
MS\Internal\PtsHost\TextParagraph.cs (2)
833ddcpOld = Math.Min(ddcpOld, (LastFormatCch - dcpStart) + 1); 834ddcpNew = Math.Min(ddcpNew, (Cch - dcpStart) + 1);
MS\Internal\Text\ComplexLine.cs (1)
563offset = Math.Min(_dcp + this.Length, offset);
MS\Internal\Text\SimpleLine.cs (1)
89Math.Min(dcp, _content.Length)
System\Windows\Controls\DataGrid.cs (7)
2650indexToSelect = Math.Min(Items.Count - numSelected - 1, indexToSelect); 5092int previousStartIndex = Math.Min(startIndex, currentCellIndex); 5094int previousStartColumnIndex = Math.Min(startColumnIndex, currentCellColumnIndex); 5135_selectedCells.AddRegion(Math.Min(startIndex, endIndex), Math.Min(startColumnIndex, endColumnIndex), newRowCount, newColumnCount); 5999index = Math.Max(0, Math.Min(numItems - 1, index + (shiftModifier ? -1 : 1))); 6144targetIndex = Math.Max(0, Math.Min(targetIndex, Items.Count - 1));
System\Windows\Controls\DataGridColumnCollection.cs (2)
754int columnCount = Math.Min(newFrozenCount, Count); 762int columnCount = Math.Min(oldFrozenCount, Count);
System\Windows\Controls\Grid.cs (4)
917cell.ColumnIndex = Math.Min(GetColumn(child), DefinitionsU.Length - 1); 920cell.RowIndex = Math.Min(GetRow(child), DefinitionsV.Length - 1); 925cell.ColumnSpan = Math.Min(GetColumnSpan(child), DefinitionsU.Length - cell.ColumnIndex); 929cell.RowSpan = Math.Min(GetRowSpan(child), DefinitionsV.Length - cell.RowIndex);
System\Windows\Controls\ItemContainerGenerator.cs (1)
2764int index = Math.Min(oldIndex, newIndex);
System\Windows\Controls\PasswordTextNavigator.cs (2)
200finalCount = Math.Min(count, _container.SymbolCount - _offset); 204finalCount = Math.Min(count, _offset);
System\Windows\Controls\Primitives\DataGridCellsPresenter.cs (1)
134dirtyCount = Math.Min(newColumnCount, oldColumnCount);
System\Windows\Controls\PrintDialog.cs (1)
316Math.Min((int)dlg.MaxPage, _pageRange.PageTo));
System\Windows\Controls\Stack.cs (1)
1001iNewOffset = Math.Max(Math.Min(numberOfItems - 1, iNewOffset), 0);
System\Windows\Controls\TextBlock.cs (1)
2332int dcpEnd = Math.Min(dcpLineEnd, dcpPositionEnd);
System\Windows\Controls\TextBox.cs (1)
1729if ( 2*(prefix + suffix) >= Math.Min(oldText.Length, newText.Length))
System\Windows\Controls\VirtualizedCellInfoCollection.cs (6)
615int right = Math.Min(Right, region.Right); 616int bottom = Math.Min(Bottom, region.Bottom); 686Left = Math.Min(Left, region.Left); 687Top = Math.Min(Top, region.Top); 730int bottom = Math.Min(Bottom, region.Bottom); 738int bottom = Math.Min(Bottom, region.Bottom);
System\Windows\Controls\VirtualizingStackPanel.cs (1)
9552return Math.Min(ItemCount, _firstItemInExtendedViewportIndex + _actualItemsInExtendedViewportCount);
System\Windows\Documents\Block.cs (2)
489double maxLineHeight = Math.Min(1000000, PTS.MaxFontSize); 533double maxThickness = Math.Min(1000000, PTS.MaxPageSize);
System\Windows\Documents\Figure.cs (1)
300double maxOffset = Math.Min(1000000, PTS.MaxPageSize);
System\Windows\Documents\FixedPageStructure.cs (1)
138line = Math.Max(0, Math.Min(line, _lineResults.Length - 1));
System\Windows\Documents\Floater.cs (1)
133double maxWidth = Math.Min(1000000, PTS.MaxPageSize);
System\Windows\Documents\FlowDocument.cs (5)
1529double maxSize = Math.Min(1000000, PTS.MaxPageSize); 1544double maxSize = Math.Min(1000000, PTS.MaxPageSize); 1559double maxSize = Math.Min(1000000, PTS.MaxPageSize); 1580double maxRuleWidth = Math.Min(1000000, PTS.MaxPageSize); 1591double maxGap = Math.Min(1000000, PTS.MaxPageSize);
System\Windows\Documents\FlowPosition.cs (1)
218maxLength = Math.Min(maxLength, remainingLength);
System\Windows\Documents\ImmComposition.cs (1)
1128_caretOffset = Math.Min(_caretOffset, text.Length);
System\Windows\Documents\List.cs (1)
327double maxOffset = Math.Min(1000000, PTS.MaxPageSize);
System\Windows\Documents\Paragraph.cs (1)
303double maxIndent = Math.Min(1000000, PTS.MaxPageSize);
System\Windows\Documents\Speller.cs (5)
1017int timeOutOffset = Math.Min(data.TextMap.ContentEndOffset, sentenceEndOffset); 1204contextOffset = Math.Min(sTextRange.Start, contentOffset); 1209sTextRange = (SpellerInteropBase.ITextRange)segments[Math.Min(i, segments.Count-1)]; 1718runCount = Math.Min(runCount, _text.Length - _textLength); 1719runCount = Math.Min(runCount, position.GetOffsetToPosition(contextEnd));
System\Windows\Documents\Table.cs (1)
387double maxSpacing = Math.Min(1000000, PTS.MaxPageSize);
System\Windows\Documents\TableColumn.cs (1)
205double maxPixel = Math.Min(1000000, PTS.MaxPageSize);
System\Windows\Documents\TextContainerChangedEventArgs.cs (1)
403int cancelledCount = Math.Min(overlap, newChange.RemovedLength);
System\Windows\Documents\TextElement.cs (1)
1606double maxFontSize = Math.Min(1000000, PTS.MaxFontSize);
System\Windows\Documents\TextFindEngine.cs (3)
671runCount = Math.Min(runCount, findText.Length - findTextLength); 675runCount = Math.Min(runCount, navigator.GetOffsetToPosition(endPosition)); 685runCount = Math.Min(runCount, startPosition.GetOffsetToPosition(navigator));
System\Windows\Documents\TextPointer.cs (1)
1795finalCount += Math.Min(count - finalCount, textNode.SymbolCount - skipCount);
System\Windows\Documents\TextPointerBase.cs (5)
104maxCount = Math.Min(count, thisPointer.GetOffsetToPosition(limit)); 108maxCount = Math.Min(count, limit.GetOffsetToPosition(thisPointer)); 110maxCount = Math.Min(count, maxCount); 1429runLength = Math.Min(navigator.GetTextRunLength(LogicalDirection.Backward), SelectionWordBreaker.MinContextLength - preceedingCount); 1448runLength = Math.Min(navigator.GetTextRunLength(LogicalDirection.Forward), SelectionWordBreaker.MinContextLength - followingCount);
System\Windows\Documents\TextRangeEdit.cs (2)
2348new DoublePropertyRange (Paragraph.TextIndentProperty, -Math.Min(1000000, PTS.MaxPageSize), Math.Min(1000000, PTS.MaxPageSize))
System\Windows\Documents\TextRangeEditTables.cs (2)
335int firstRowIndex = Math.Min(anchorCell.Row.Index, movingCell.Row.Index); 337int firstColumnIndex = Math.Min(anchorCell.ColumnIndex, movingCell.ColumnIndex);
System\Windows\Documents\TextStore.cs (1)
2479runCount = TextPointerBase.GetTextWithLimit(navigator, LogicalDirection.Forward, text, charsCopied, Math.Min(cchReq, text.Length - charsCopied), limit);
System\Windows\Documents\TextTreeText.cs (4)
104firstCount = Math.Min(count, firstBlock.Count - firstBlockLocalOffset); 301count = Math.Min(rightBlock.FreeCapacity, length - textOffset); 343count = Math.Min(neighborBlock.FreeCapacity, textEndOffset - textOffset); 357count = Math.Min(rightBlock.FreeCapacity, textEndOffset - textOffset);
System\Windows\Documents\TextTreeTextBlock.cs (4)
95newText = new char[Math.Min(this.Count + count, MaxBlockSize)]; 110count = Math.Min(count, _gapSize); 249copyCount = Math.Min(count, _gapOffset - logicalOffset); 264copyCount = Math.Min(count, _text.Length - logicalOffset);
System\Windows\Documents\WinRTSpellerInteropExtensions.cs (1)
175int altFormsCount = Math.Min(missingFragmentText.Length, AlternateFormsMaximumCount);
System\Windows\FigureLength.cs (1)
101double maxPixel = Math.Min(1000000, PTS.MaxPageSize);
System\Windows\Standard\NativeMethods.cs (2)
2049Left = Math.Min(rect1.Left, rect2.Left), 2050Top = Math.Min(rect1.Top, rect2.Top),
ReachFramework (6)
MS\Internal\Printing\Configuration\COMPSTUISRID.cs (1)
42resString.Length = Math.Max(0, Math.Min(charCount, resString.Length));
MS\Internal\Printing\Configuration\DevMode.cs (1)
632int charsToWrite = Math.Min(value.Length, maxCharsToWrite - 1);
PrintConfig\FallbackPTProvider.cs (1)
160defaultCopies = Math.Max(minCopies, Math.Min(defaultDevMode.Copies, maxCopies));
PrintConfig\PrintSchemaShim.cs (1)
1183return (short)Math.Max(min, Math.Min(value, max));
PrintConfig\PTProvider.cs (2)
684int bytesToWrite = Math.Min(data.Length, (int)(byteCount - totalBytesWritten)); 738int bytesToRead = Math.Min(data.Length, (int)(byteCount - totalBytesRead));
SignalRSamples (1)
Hubs\UploadHub.cs (1)
44return $"{winner} wins with a total of {Math.Max(p1score, p2score)} points to {Math.Min(p1score, p2score)}";
Sockets.FunctionalTests (3)
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (2)
149var size = Math.Min(data.Length - bytesWritten, maxSendSize); 242var size = Math.Min(data.Length - bytesWritten, maxSendSize);
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (1)
1103var received = await stream.ReadAsync(receiveBuffer, 0, Math.Min(receiveBuffer.Length, expectedBytes - totalReceived));
Swaggatherer (1)
SwaggathererApplication.cs (1)
257var length = Math.Min(text.Length, Math.Max(5, part.Name.Length));
System.Collections (2)
System\Collections\Generic\PriorityQueue.cs (2)
786int childIndexUpperBound = Math.Min(i + Arity, size); 835int childIndexUpperBound = Math.Min(i + Arity, size);
System.Collections.Concurrent (1)
System\Collections\Concurrent\PartitionerStatic.cs (1)
451requestedChunkSize = Math.Min(_currentChunkSize.Value * 2, _maxChunkSize);
System.Collections.Immutable (2)
System\Collections\Frozen\FrozenHashTable.cs (1)
226Array.Clear(seenBuckets, 0, Math.Min(numBuckets, seenBuckets.Length));
System\Collections\Frozen\String\KeyAnalyzer.cs (1)
74int maxSubstringLength = Math.Min(minLength, MaxSubstringLengthLimit);
System.ComponentModel.TypeConverter (1)
System\ComponentModel\Container.cs (1)
226for (int i = 0; i < Math.Min(_siteCount, _sites!.Length); i++)
System.Data.Common (20)
System\Data\Common\AdapterUtil.Common.cs (1)
794startIndex = Math.Min(startIndex, index);
System\Data\Common\DbDataAdapter.cs (1)
987int maxBatchCommands = Math.Min(UpdateBatchSize, dataRows.Length);
System\Data\Common\Int32Storage.cs (1)
111min = Math.Min(_values[record], min);
System\Data\Common\ObjectStorage.cs (1)
310Array.Copy(_values, newValues, Math.Min(capacity, _values.Length));
System\Data\Common\StringStorage.cs (1)
185Array.Copy(_values, newValues, Math.Min(capacity, _values.Length));
System\Data\DataError.cs (1)
141int newCapacity = Math.Min(_count * 2, column.Table!.Columns.Count);
System\Data\DataTableReader.cs (2)
368int byteCount = Math.Min(tempBuffer.Length - srcIndex, length); 431int charCount = Math.Min(tempBuffer.Length - srcIndex, length);
System\Data\ProviderBase\SchemaMapping.cs (2)
299Debug.Assert(_mappedLength == Math.Min(_readerDataValues!.Length, _mappedDataValues!.Length), "incorrect precomputed length"); 1240_mappedLength = Math.Min(count, mappingCount);
System\Data\RecordManager.cs (1)
39Array.Copy(_rows, newRows, Math.Min(_lastFreeRecord, _rows.Length));
System\Data\SQLTypes\SQLBytes.cs (1)
326int count = Math.Min(buffer.Length, (int)(Length - offset));
System\Data\SQLTypes\SQLDecimal.cs (8)
1261ResPrec = Math.Min(MaxPrecision, ResPrec); 1465ResScale = Math.Min((ResPrec - ResInteger), ResScale); 1467ResScale = Math.Max(ResScale, Math.Min(ActualScale, s_cNumeDivScaleMin)); 1691MinScale = Math.Min(ResScale, s_cNumeDivScaleMin); 1693ResInteger = Math.Min(ResInteger, s_NUMERIC_MAX_PRECISION); 1700ResScale = Math.Min((ResPrec - ResInteger), ResScale); 2297bNewPrec = (byte)(Math.Min(s_NUMERIC_MAX_PRECISION, Math.Max(1, lAdjust + _bPrec))); 3168lPosition = Math.Min(s_NUMERIC_MAX_PRECISION, lPosition);
System.Diagnostics.DiagnosticSource (2)
System\Diagnostics\Metrics\CounterAggregator.cs (1)
21private readonly PaddedDouble[] _deltas = new PaddedDouble[Math.Min(Environment.ProcessorCount, 8)];
System\Diagnostics\Metrics\ExponentialHistogramAggregator.cs (1)
201return Math.Min(Math.Max(0, (int)(quantile * count)), count - 1);
System.Diagnostics.Process (1)
System\Diagnostics\ProcessWaitState.Unix.cs (1)
538pollingIntervalMs = Math.Min(pollingIntervalMs * 2, MaxPollingIntervalMs);
System.Drawing.Primitives (4)
System\Drawing\Rectangle.cs (4)
291int x2 = Math.Min(a.X + a.Width, b.X + b.Width); 293int y2 = Math.Min(a.Y + a.Height, b.Y + b.Height); 315int x1 = Math.Min(a.X, b.X); 317int y1 = Math.Min(a.Y, b.Y);
System.Formats.Asn1 (3)
System\Formats\Asn1\AsnDecoder.cs (1)
641int len = Math.Min(longestPermitted, source.Length);
System\Formats\Asn1\AsnWriter.Oid.cs (1)
176oidValue = oidValue.Slice(Math.Min(oidValue.Length, endIndex + 1));
System\Formats\Asn1\SetOfValueComparer.cs (1)
17int min = Math.Min(x.Length, y.Length);
System.Formats.Tar (2)
System\Formats\Tar\TarHeader.Write.cs (2)
987int numToCopy = Math.Min(bytesToWrite.Length, destination.Length); 1004int numToCopy = Math.Min(bytesToWrite.Length, destination.Length - 1);
System.IO.Compression (3)
System\IO\Compression\DeflateManaged\InputBuffer.cs (1)
149int length = Math.Min(output.Length, _buffer.Length);
System\IO\Compression\DeflateManaged\OutputWindow.cs (2)
88length = Math.Min(Math.Min(length, WindowSize - _bytesUsed), input.AvailableBytes);
System.IO.Pipelines (4)
System\IO\Pipelines\Pipe.cs (2)
264int adjustedToMaximumSize = Math.Min(maxBufferSize, sizeHint); 1107int writable = Math.Min(destination.Length, source.Length);
System\IO\Pipelines\StreamPipeReader.cs (1)
539int adjustedToMaximumSize = Math.Min(maxBufferSize, sizeHint);
System\IO\Pipelines\StreamPipeWriter.cs (1)
180var adjustedToMaximumSize = Math.Min(maxBufferSize, sizeHint);
System.Linq (9)
System\Linq\Chunk.cs (2)
66TSource[] chunk = new ReadOnlySpan<TSource>(source, index, Math.Min(size, source.Length - index)).ToArray(); 82int arraySize = Math.Min(size, 4);
System\Linq\SegmentedArrayBuilder.cs (1)
144ReadOnlySpan<T> sourceSlice = sourceSpan.Slice(0, Math.Min(availableSpaceInCurrentSpan, sourceSpan.Length));
System\Linq\Select.SpeedOpt.cs (2)
851return _selector(_source[Math.Min(lastIndex, _maxIndexInclusive)]); 868return Math.Min(count - 1, _maxIndexInclusive) - _minIndexInclusive + 1;
System\Linq\SkipTake.SpeedOpt.cs (2)
97return _source[Math.Min(lastIndex, _maxIndexInclusive)]; 114return Math.Min(count - 1, _maxIndexInclusive) - _minIndexInclusive + 1;
System\Linq\Take.cs (2)
135Debug.Assert(queue.Count == Math.Min(count, startIndex)); 187Math.Min(count, isEndIndexFromEnd ? count - endIndex : endIndex);
System.Linq.Expressions (1)
System\Runtime\CompilerServices\RuleCache.cs (1)
47int max = Math.Min(_rules.Length, i + count);
System.Linq.Parallel (4)
System\Linq\Parallel\QueryOperators\Binary\ZipQueryOperator.cs (1)
184_count = Math.Min(_leftChildResults.Count, _rightChildResults.Count);
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs (1)
377return Math.Min(_childCount, _takeOrSkipOp._count);
System\Linq\Parallel\Scheduling\Scheduling.cs (1)
34internal static readonly int DefaultDegreeOfParallelism = Math.Min(Environment.ProcessorCount, MAX_SUPPORTED_DOP);
System\Linq\Parallel\Utils\Sorting.cs (1)
384_sharedBarriers[phase][Math.Min(_partitionIndex, partnerIndex)].SignalAndWait(cancelToken);
System.Memory (2)
System\Buffers\BuffersExtensions.cs (1)
137int writeSize = Math.Min(destination.Length, input.Length);
System\Buffers\SequenceReader.cs (1)
444int toCopy = Math.Min(nextSpan.Length, destination.Length - copied);
System.Memory.Data (1)
System\BinaryData.cs (1)
311bufferSize = longLength == 0 ? 1 : Math.Min((int)longLength, CopyToBufferSize);
System.Net.Http (21)
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\DynamicTable.cs (1)
83int headCount = Math.Min(_buffer.Length - _removeIndex, _count);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs (4)
420int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 458int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs (2)
287int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex); 373int count = Math.Min(_stringLength - _stringIndex, data.Length - currentIndex);
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
140byteCount = Math.Min(byteCount, limit - ActiveMemory.Length);
System\Net\Http\Headers\AltSvcHeaderParser.cs (1)
140maxAge = Math.Min(maxAge.GetValueOrDefault(), maxAgeTmp);
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (1)
367int bytesToConsume = Math.Min(maxBytesToRead, (int)Math.Min((ulong)connectionBuffer.Length, _chunkBytesRemaining));
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (1)
184int bytesToConsume = Math.Min(maxBytesToRead, (int)Math.Min((ulong)connectionBuffer.Length, _contentBytesRemaining));
System\Net\Http\SocketsHttpHandler\CreditManager.cs (2)
106int granted = Math.Min(waiter.Amount, _current); 169int granted = Math.Min(amount, _current);
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (2)
434string response = Encoding.ASCII.GetString(_incomingBuffer.ActiveSpan.Slice(0, Math.Min(20, _incomingBuffer.ActiveLength))); 1700int frameSize = Math.Min(remaining.Length, FrameHeader.MaxPayloadLength);
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (3)
484int granted = Math.Min(_availableCredit, _creditWaiter.Amount); 1116int bytesRead = Math.Min(buffer.Length, activeBuffer.Length); 1285sendSize = Math.Min(buffer.Length, _availableCredit);
System\Net\Http\SocketsHttpHandler\Http2StreamWindowManager.cs (1)
114int extendedWindowSize = Math.Min(MaxStreamWindowSize, _streamWindowSize * 2);
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (1)
77_headerDecoder = new QPackDecoder(maxHeadersLength: (int)Math.Min(int.MaxValue, _headerBudgetRemaining));
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
1709int toCopy = Math.Min(available.Length, buffer.Length);
System.Net.HttpListener (5)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
35Log.DumpBuffer(IdOf(thisOrContextObject), memberName, buffer.Slice(0, Math.Min(buffer.Length, MaxDumpSize)).ToArray());
System\Net\Managed\ChunkedInputStream.cs (1)
142ares._count = Math.Min(8192, _decoder.ChunkLeft + 6);
System\Net\Managed\HttpRequestStream.Managed.cs (2)
76int size = Math.Min(_length, count); 82size = Math.Min(size, _buffer.Length - _offset);
System\Net\Managed\HttpResponseStream.Managed.cs (1)
184int new_count = Math.Min(size, 16384 - (int)ms.Position + (int)start);
System.Net.Mail (4)
System\Net\BufferedReadStream.cs (2)
53read = Math.Min(count, _storedLength - _storedOffset); 75read = Math.Min(count, _storedLength - _storedOffset);
System\Net\Mail\SmtpReplyReaderFactory.cs (2)
327int left = Math.Min(4 - statusRead, actual); 461int left = Math.Min(4 - _statusRead, actual);
System.Net.NameResolution (1)
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (1)
181buffer[0] = (byte)Math.Min(buffer.Length, 255);
System.Net.Ping (1)
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (1)
181buffer[0] = (byte)Math.Min(buffer.Length, 255);
System.Net.Primitives (4)
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (1)
181buffer[0] = (byte)Math.Min(buffer.Length, 255);
System\Net\CookieContainer.cs (3)
423int min_count = Math.Min((int)(domain_count * remainingFraction), Math.Min(m_maxCookiesPerDomain, m_maxCookies) - 1); 1118int length = Math.Min(ll, lr);
System.Net.Quic (5)
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
140byteCount = Math.Min(byteCount, limit - ActiveMemory.Length);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (1)
181buffer[0] = (byte)Math.Min(buffer.Length, 255);
src\libraries\Common\src\System\Net\StreamBuffer.cs (2)
112int bytesWritten = Math.Min(buffer.Length, _buffer.AvailableMemory.Length); 205int bytesRead = Math.Min(buffer.Length, _buffer.ActiveMemory.Length);
System\Net\Quic\Internal\ReceiveBuffers.cs (1)
77copied = Math.Min(buffer.Length, activeBuffer.Length);
System.Net.Security (6)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
35Log.DumpBuffer(IdOf(thisOrContextObject), memberName, buffer.Slice(0, Math.Min(buffer.Length, MaxDumpSize)).ToArray());
System\Net\Security\NegotiateStream.cs (3)
354int copyBytes = Math.Min(_readBufferCount, buffer.Length); 430int copyBytes = Math.Min(_readBufferCount, buffer.Length); 520int chunkBytes = Math.Min(buffer.Length, MaxWriteDataSize);
System\Net\Security\SslStream.IO.cs (2)
591int chunkBytes = Math.Min(buffer.Length, MaxDataSize); 975int copyBytes = Math.Min(_buffer.DecryptedLength, buffer.Length);
System.Net.Sockets (2)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
35Log.DumpBuffer(IdOf(thisOrContextObject), memberName, buffer.Slice(0, Math.Min(buffer.Length, MaxDumpSize)).ToArray());
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (1)
181buffer[0] = (byte)Math.Min(buffer.Length, 255);
System.Net.WebClient (1)
src\libraries\Common\src\System\IO\ChunkedMemoryStream.cs (1)
50int toCopy = Math.Min(remaining, buffer.Length);
System.Net.WebSockets (1)
System\Net\WebSockets\ManagedWebSocket.cs (1)
830int receiveBufferBytesToCopy = Math.Min(limit, _receiveBufferCount);
System.Private.CoreLib (85)
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (1)
111int newSegmentSize = Math.Min(_tail._array.Length * 2, MaxSegmentSize);
src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
843int zeroes = Math.Min(-digPos, nMaxDigits);
src\libraries\Common\src\System\Number.Parsing.Common.cs (1)
227numberOfTrailingZeros = Math.Min(numberOfTrailingZeros, numberOfFractionalDigits);
src\libraries\System.Private.CoreLib\src\System\Array.cs (1)
67(uint)Math.Min(newSize, larray.Length));
src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (1)
508return Math.Min(partitionCount, Environment.ProcessorCount);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Number.cs (2)
113int numNonLeadingDigitsBeforeDecimalToCopy = Math.Min(numNonLeadingDigitsBeforeDecimal, maxDigitCount); 177int numDigitsAfterDecimalToCopy = Math.Min(srcIndex - startIndexOfDigitsAfterDecimalToCopy, maxDigitCount - dstIndex);
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (1)
645int nextSize = tail._preservedForObservation ? InitialSegmentLength : Math.Min(tail.Capacity * 2, MaxSegmentLength);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Queue.cs (1)
112int firstPart = Math.Min(_array.Length - _head, numToCopy);
src\libraries\System.Private.CoreLib\src\System\Decimal.DecCalc.cs (3)
1910curScale = Math.Min(9, -scale); 2005curScale = Math.Min(9, -scale); 2067curScale = Math.Min(9, -scale);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (1)
293sleepDurationInMilliseconds = Math.Min(sleepDurationInMilliseconds, millisecondsTillNextPoll);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (3)
2014int paramCount = Math.Min(eventTypes.typeInfos.Length, args.Length); // parameter count mismatch get logged in LogEventArgsMismatches 2075args = new object?[Math.Min(eventDataCount, metadata.Parameters.Length)]; 2876dataDescrs[1].Size = (uint)Math.Min(dataLeft, chunkSize);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\XplatEventLogger.cs (1)
90eventDataCount = Math.Min(payloadName.Count, payload.Count);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (1)
76int length = Math.Min(WINDOWS_MAX_COLLATION_NAME_LENGTH, endOfCollation - collationIndex); // Windows doesn't allow collation names longer than 8 characters
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (5)
464FormatDigits(ref result, hour12, Math.Min(tokenLen, 2)); 469FormatDigits(ref result, dateTime.Hour, Math.Min(tokenLen, 2)); 474FormatDigits(ref result, dateTime.Minute, Math.Min(tokenLen, 2)); 479FormatDigits(ref result, dateTime.Second, Math.Min(tokenLen, 2)); 638FormatDigits(ref result, year, Math.Min(tokenLen, 2));
src\libraries\System.Private.CoreLib\src\System\Globalization\InvariantModeCasing.cs (1)
185int length = Math.Min(lengthA, lengthB);
src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.cs (1)
18int length = Math.Min(lengthA, lengthB);
src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.Utf8.cs (4)
23int length = Math.Min(lengthA, lengthB); 176int length = Math.Min(lengthA, lengthB); 336int length = Math.Min(sourceLength, prefixLength); 486int length = Math.Min(sourceLength, prefixLength);
src\libraries\System.Private.CoreLib\src\System\Globalization\OrdinalCasing.Icu.cs (1)
191int length = Math.Min(lengthA, lengthB);
src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
696public static int Min(int x, int y) => Math.Min(x, y);
src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (2)
265int readLength = Math.Min(MaxCharBytesSize, stringLength - currPos); 286sb ??= StringBuilderCache.Acquire(Math.Min(stringLength, StringBuilderCache.MaxBuilderSize)); // Actual string length in chars may be smaller.
src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (3)
124byte[] shadowBuffer = new byte[Math.Min(_bufferSize + _bufferSize, MaxShadowBufferSize)]; 448int readbytes = Math.Min(_readLen - _readPos, destination.Length); 768int bytesToWrite = Math.Min(_bufferSize - _writePos, count);
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (3)
1287int bytesNeeded = preambleSize + encoding.GetMaxByteCount(Math.Min(contents.Length, ChunkSize)); 1344byte[] bytes = ArrayPool<byte>.Shared.Rent(preambleSize + encoding.GetMaxByteCount(Math.Min(contents.Length, ChunkSize))); 1361ReadOnlyMemory<char> toEncode = remaining.Slice(0, Math.Min(remaining.Length, ChunkSize));
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (1)
357int n = Math.Min(_length - _position, buffer.Length);
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (3)
373int n = Math.Min(_readLen - _readPos, destination.Length); 407bytesFromBuffer = Math.Min(buffer.Length, _readLen - _readPos); 447bytesFromBuffer = Math.Min(_readLen, buffer.Length);
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (2)
440int n = Math.Min(charBuffer.Length - dstPos, count); 791int n = Math.Min(_charLen - _charPos, source.Length - copied);
src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyName.cs (1)
353short maxSize = (short)Math.Min(end - i, (int)c_MaxUnicodeCharsReallocate - 1);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (1)
47minimumLength = Math.Min(minimumLength, value.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (1)
458minLength = Math.Min(minLength, value.Length);
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (9)
86int length = Math.Min(strA.Length, strB.Length); 322lengthA = Math.Min(lengthA, strA.Length - indexA); 327lengthB = Math.Min(lengthB, strB.Length - indexB); 357lengthA = Math.Min(lengthA, strA.Length - indexA); 362lengthB = Math.Min(lengthB, strB.Length - indexB); 402int lengthA = Math.Min(length, strA.Length - indexA); 403int lengthB = Math.Min(length, strB.Length - indexB); 483int lengthA = Math.Min(length, strA.Length - indexA); 484int lengthB = Math.Min(length, strB.Length - indexB);
src\libraries\System.Private.CoreLib\src\System\Text\ASCIIEncoding.cs (2)
375int bytesWritten = (int)Ascii.NarrowUtf16ToAscii(pChars, pBytes, (uint)Math.Min(charsLength, bytesLength)); 666bytesConsumed = (int)Ascii.WidenAsciiToUtf16(pBytes, pChars, (uint)Math.Min(charsLength, bytesLength));
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (2)
321int bytesWritten = (int)Latin1Utility.NarrowUtf16ToLatin1(pChars, pBytes, (uint)Math.Min(charsLength, bytesLength)); 621int charsWritten = Math.Min(bytesLength, charsLength);
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (12)
159capacity = Math.Min(DefaultCapacity, maxCapacity); 207persistedCapacity = Math.Min(Math.Max(DefaultCapacity, persistedString.Length), persistedMaxCapacity); 417int capacityToPreserve = Math.Min(Capacity, Math.Max(Length * 6 / 5, m_ChunkChars.Length)); 845int length = Math.Min(m_ChunkChars.Length - m_ChunkLength, count); 849length = Math.Min(m_ChunkChars.Length - m_ChunkLength, count); 908chunkEndIndex = Math.Min(chunkEndIndex, chunk.m_ChunkLength); 2108ReadOnlySpan<char> remainingChunk = chunk.m_ChunkChars.AsSpan(indexInChunk, Math.Min(chunk.m_ChunkLength - indexInChunk, count)); 2144Debug.Assert(oldValue.Length > Math.Min(count, chunk.m_ChunkLength - indexInChunk), 2231int endInChunk = Math.Min(chunk.m_ChunkLength, endIndexInChunk); 2475int lengthToCopy = Math.Min(lengthInChunk, count); 2561int newBlockLength = Math.Max(minBlockCharCount, Math.Min(Length, MaxChunkSize)); 2673int copyCount1 = Math.Min(count, indexInChunk);
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (2)
353int bytesToReturn = Math.Min(_readBufferCount, buffer.Length); 432int bytesToReturn = Math.Min(_readBufferCount, buffer.Length);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Transcoding.cs (2)
30nuint numElementsConverted = Ascii.WidenAsciiToUtf16(pInputBuffer, pOutputBuffer, (uint)Math.Min(inputLength, outputCharsRemaining)); 851nuint numElementsConverted = Ascii.NarrowUtf16ToAscii(pInputBuffer, pOutputBuffer, (uint)Math.Min(inputLength, outputBytesRemaining));
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.cs (2)
272_legacy_maxIOCompletionThreads = (short)Math.Min(ioCompletionThreads, MaxPossibleThreadCount); 274short newMaxThreads = (short)Math.Min(workerThreads, MaxPossibleThreadCount);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.HillClimbing.cs (2)
321newThreadWaveMagnitude = Math.Min(newThreadWaveMagnitude, _maxThreadWaveMagnitude); 343newThreadCount = Math.Min(maxThreads, newThreadCount);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (1)
234timeoutDurationMs = Math.Min(handleTimeoutDurationMs, timeoutDurationMs);
src\libraries\System.Private.CoreLib\src\System\Threading\ProcessorIdCache.cs (1)
136s_processorIdRefreshRate = Math.Min((int)(minID * 5 / minTLS), MaxIdRefreshRate);
src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (1)
791int waitersToNotify = Math.Min(currentCount, waitCount) - m_countOfWaitersPulsedToWake;
src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandle.cs (1)
223Math.Min(MaxWaitHandles, 2 * currentLength))];
System.Private.DataContractSerialization (36)
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (1)
266int size = Math.Min(_chars.Length, buffer.Length);
System\Runtime\Serialization\Json\XmlJsonReader.cs (1)
755actual = Math.Min(count, value.Length);
System\Runtime\Serialization\XmlReaderDelegator.cs (1)
793return Math.Min(context.RemainingItemCount, dictionaryReader.Quotas.MaxArrayLength);
System\Xml\ArrayHelper.cs (1)
69count = Math.Min(count, 256);
System\Xml\EncodingStreamWrapper.cs (2)
312int max = offset + Math.Min(count, BufferLength); 470int inputCount = Math.Min(count, BufferLength * 2);
System\Xml\ValueHandle.cs (4)
663actual = Math.Min(_length, count); 673int charCount = Math.Min(count / 3 * 4, _length); 742actualByteCount = Math.Min(charCount, byteCount); 807int charCount = Math.Min(count, _length / sizeof(char));
System\Xml\XmlBaseReader.cs (6)
1148actual = Math.Min(count, value.Length); 1178return ReadBytes(DataContractSerializer.Base64Encoding, 3, 4, buffer, offset, Math.Min(count, 512), false); 1370return ReadBytes(DataContractSerializer.Base64Encoding, 3, 4, buffer, offset, Math.Min(count, 512), true); 1390return ReadBytes(DataContractSerializer.BinHexEncoding, 1, 2, buffer, offset, Math.Min(count, 512), true); 1425int actual = Math.Min(_trailByteCount, byteCount); 1493int actual = Math.Min(_trailByteCount, byteCount);
System\Xml\XmlBinaryReader.cs (10)
1240int actual = Math.Min(count, _arrayCount); 1263int actual = Math.Min(count, _arrayCount); 1286int actual = Math.Min(count, _arrayCount); 1309int actual = Math.Min(count, _arrayCount); 1332int actual = Math.Min(count, _arrayCount); 1355int actual = Math.Min(count, _arrayCount); 1378int actual = Math.Min(count, _arrayCount); 1402int actual = Math.Min(count, _arrayCount); 1431int actual = Math.Min(count, _arrayCount); 1467int actual = Math.Min(count, _arrayCount);
System\Xml\XmlBinaryReaderSession.cs (1)
47XmlDictionaryString[] newStrings = new XmlDictionaryString[Math.Min(Math.Max(id + 1, _strings.Length * 2), MaxArrayEntries)];
System\Xml\XmlBufferReader.cs (5)
163TryEnsureBytes(Math.Min(count, _windowOffsetMax - offset)); 230newOffsetMax = Math.Min(newOffsetMax, newBuffer.Length); 872int length = Math.Min(byteLength, charLength); 886int length = Math.Min(byteLength, charLength); 918int length = Math.Min(length1, length2);
System\Xml\XmlCanonicalWriter.cs (1)
832int length = Math.Min(length1, length2);
System\Xml\XmlSigningNodeWriter.cs (1)
360int byteCount = Math.Min(_base64Chars.Length / 4 * 3, count - count % 3);
System\Xml\XmlUTF8TextWriter.cs (2)
654int byteCount = Math.Min(bufferLength / 4 * 3, count - count % 3); 673int byteCount = Math.Min(bufferLength / 4 * 3, count - count % 3);
System.Private.Xml (9)
System\Xml\Core\XmlReader.cs (1)
1712int bytesToRead = Math.Min(bytes.Length, 2);
System\Xml\Core\XmlTextReaderImpl.cs (1)
2885int bytesToRead = Math.Min(4, _ps.bytes.Length - _ps.bytesUsed);
System\Xml\Core\XmlTextReaderImplAsync.cs (1)
913int bytesToRead = Math.Min(4, _ps.bytes.Length - _ps.bytesUsed);
System\Xml\Core\XmlTextWriter.cs (1)
1450_textWriter.Write(_indentChars, 0, Math.Min(i, _indentChars.Length));
System\Xml\Schema\BitSet.cs (1)
219int i = Math.Min(_bits.Length, other._bits.Length);
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (2)
1237for (int j = 0; j < Math.Min(pLength, mapping.Members.Length); j++) 1268for (int j = 0; j < Math.Min(pLength, mapping.Members.Length); j++)
System\Xml\Serialization\XmlSerializationReader.cs (2)
482currentSize = Math.Min(currentSize * 2, MAX_ALLOC_SIZE); 503currentSize = Math.Min(block.Length, total);
System.Reflection.Emit (1)
System\Reflection\Emit\ILGeneratorImpl.cs (1)
48internal int GetMaxStack() => Math.Min(ushort.MaxValue, _maxStackDepth + _depthAdjustment);
System.Reflection.Metadata (17)
System\Reflection\Internal\Utilities\ImmutableMemoryStream.cs (2)
69int result = Math.Min(count, _array.Length - _position); 80int result = Math.Min(buffer.Length, _array.Length - _position);
System\Reflection\Internal\Utilities\MemoryBlock.cs (1)
67displayedBytes = Math.Min(Length, 64);
System\Reflection\Internal\Utilities\ReadOnlyUnmanagedMemoryStream.cs (2)
33int bytesRead = Math.Min(count, _length - _position); 44int bytesRead = Math.Min(buffer.Length, _length - _position);
System\Reflection\Internal\Utilities\StreamExtensions.cs (2)
24byte[] buffer = new byte[Math.Min(StreamCopyBufferSize, size)]; 27int readSize = Math.Min(size, buffer.Length);
System\Reflection\Metadata\BlobBuilder.cs (5)
236int minLength = Math.Min(left.Length - leftStart, right.Length - rightStart); 287int bytesToCopy = Math.Min(bufferEnd, chunkEnd) - bufferStart; 634int bytesToCurrent = Math.Min(FreeBytes, byteCount); 674int bytesToCurrent = Math.Min(FreeBytes, buffer.Length); 712int bytesToCurrent = Math.Min(FreeBytes, byteCount);
System\Reflection\Metadata\Ecma335\Encoding\ControlFlowBuilder.cs (2)
30internal int OperandSize => Math.Min(_instructionEndDisplacement, 4); 303int chunkSize = Math.Min(branch.OperandOffset - srcOffset, srcBlob.Length - srcBlobOffset);
System\Reflection\PortableExecutable\PEBuilder.cs (2)
446length = Math.Min(remainingHeaderToSign, blobLength); 452length = Math.Min(remainingHeader, blobLength);
System\Reflection\PortableExecutable\PEReader.cs (1)
416int size = Math.Min(
System.Runtime.Caching (5)
System\Runtime\Caching\CacheExpires.cs (1)
391newLength = Math.Min(newLength, oldLength + MAX_PAGES_INCREMENT);
System\Runtime\Caching\CacheMemoryMonitor.cs (1)
215percent = Math.Min(100, (int)((cacheSize - _memoryLimit) * 100L / cacheSize));
System\Runtime\Caching\CacheUsage.cs (1)
376newLength = Math.Min(newLength, oldLength + MAX_PAGES_INCREMENT);
System\Runtime\Caching\MemoryCacheStatistics.cs (1)
81int newPollingInterval = Math.Min(_configPollingInterval, MEMORYSTATUS_INTERVAL_30_SECONDS);
System\Runtime\Caching\PhysicalMemoryMonitor.cs (1)
89percent = Math.Min(50, (int)((lastTrimPercent * TargetTotalMemoryTrimIntervalTicks) / ticksSinceTrim));
System.Runtime.Numerics (8)
src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
843int zeroes = Math.Min(-digPos, nMaxDigits);
src\libraries\Common\src\System\Number.Parsing.Common.cs (1)
227numberOfTrailingZeros = Math.Min(numberOfTrailingZeros, numberOfFractionalDigits);
System\Number.BigInteger.cs (6)
370ReadOnlySpan<byte> intDigitsSpan = chunkDigits.Slice(0, Math.Min(remainingIntDigitCount, chunkDigits.Length)); 433totalDigitCount = Math.Min(number.DigitsCount, numberScale); 450ReadOnlySpan<byte> intDigitsSpan = digitsChunkSpan.Slice(0, Math.Min(remainingIntDigitCount, digitsChunkSpan.Length)); 506int len = Math.Min(bufferSize - i, blockSize * 2); 507int lowerLen = Math.Min(len, blockSize); 567currentBufferSize = Math.Min((int)(bufferSize * digitRatio) + 1, bufferSize);
System.Runtime.Serialization.Formatters (2)
System\Runtime\Serialization\Formatters\Binary\BinaryFormatterWriter.cs (1)
244int numArrayItems = Math.Min(ChunkSize / typeLength, array.Length - arrayOffset);
System\Runtime\Serialization\Formatters\Binary\BinaryParser.cs (1)
887int numArrayItems = Math.Min(ChunkSize / typeLength, array.Length - arrayOffset);
System.Security.Cryptography (8)
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanDerivation.cs (1)
220int len = Math.Min(p.Length, retSpan.Length);
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (1)
289Span<byte> nullTerminator = destination.Slice(0, Math.Min(2, destination.Length));
System\Security\Cryptography\CryptoStream.cs (1)
315int bytesToCopy = Math.Min(_outputBufferIndex, buffer.Length);
System\Security\Cryptography\PKCS1MaskGenerationMethod.cs (1)
52Buffer.BlockCopy(hash, 0, rgbT, ib, Math.Min(rgbT.Length - ib, hash.Length));
System\Security\Cryptography\RandomNumberGenerator.cs (2)
322Span<byte> remainingRandom = randomBuffer.Slice(0, Math.Min(RandomBufferSize, needed)); 342remainingRandom = randomBuffer.Slice(0, Math.Min(RandomBufferSize, needed));
System\Security\Cryptography\X509Certificates\CertificatePolicy.cs (1)
222restriction = Math.Min(restriction, policyRestriction.Value);
System\Security\Cryptography\XmlKeyHelper.cs (1)
144int localLength = Math.Min(ByteLimit, length);
System.Text.Json (9)
System\Text\Json\JsonHelpers.Date.cs (1)
308int fractionEnd = Math.Min(sourceIndex + JsonConstants.DateTimeParseNumFractionDigits, source.Length);
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (4)
555int amountToWrite = Math.Min(span.Length, (int)_bytePositionInLine + 1); 565int amountToWrite = Math.Min(span.Length, (int)_bytePositionInLine + 1); 592int amountToWrite = Math.Min(span.Length, readSoFar.Length - written); 612amountToWrite = Math.Min(span.Length, (int)_bytePositionInLine + 1);
System\Text\Json\Serialization\Metadata\JsonTypeInfo.Cache.cs (3)
112int iForward = Math.Min(propertyIndex, count); 267int iForward = Math.Min(parameterIndex, count); 428key |= (ulong)Math.Min(length, 0xff) << 56;
System\Text\Json\ThrowHelper.cs (1)
495int printFirst10 = Math.Min(value.Length, 10);
System.Text.RegularExpressions (12)
System\Text\RegularExpressions\RegexCompiler.cs (1)
846int setsToUse = Math.Min(sets.Count, MaxSets);
System\Text\RegularExpressions\RegexNode.cs (3)
2294min = Math.Min(min, Child(i).ComputeMinLength()); 2301return Math.Min(Child(0).ComputeMinLength(), Child(1).ComputeMinLength()); 2305return Math.Min(Child(1).ComputeMinLength(), Child(2).ComputeMinLength());
System\Text\RegularExpressions\RegexParser.cs (1)
1436int c = Math.Min(3, _pattern.Length - _pos);
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (7)
114int reps = node.Kind is RegexNodeKind.One ? 1 : Math.Min(node.M, MaxPrefixLength); 164int reps = node.Kind is RegexNodeKind.Set ? 1 : Math.Min(node.M, MaxPrefixLength); 228int limit = Math.Min(node.M, MaxPrefixLength); // MaxPrefixLength here is somewhat arbitrary, as a single loop iteration could yield multiple chars 434int count = Math.Min(node.M, SingleCharIterationLimit); 442int limit = Math.Min(node.M, NodeIterationLimit); 612int minIterations = Math.Min(node.M, MaxLoopExpansion); 643int minIterations = Math.Min(node.M, MaxLoopExpansion);
System.Text.RegularExpressions.Generator (13)
RegexGenerator.Emitter.cs (1)
1107int setsToUse = Math.Min(sets.Count, MaxSets);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (3)
2294min = Math.Min(min, Child(i).ComputeMinLength()); 2301return Math.Min(Child(0).ComputeMinLength(), Child(1).ComputeMinLength()); 2305return Math.Min(Child(1).ComputeMinLength(), Child(2).ComputeMinLength());
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (1)
1436int c = Math.Min(3, _pattern.Length - _pos);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (7)
114int reps = node.Kind is RegexNodeKind.One ? 1 : Math.Min(node.M, MaxPrefixLength); 164int reps = node.Kind is RegexNodeKind.Set ? 1 : Math.Min(node.M, MaxPrefixLength); 228int limit = Math.Min(node.M, MaxPrefixLength); // MaxPrefixLength here is somewhat arbitrary, as a single loop iteration could yield multiple chars 434int count = Math.Min(node.M, SingleCharIterationLimit); 442int limit = Math.Min(node.M, NodeIterationLimit); 612int minIterations = Math.Min(node.M, MaxLoopExpansion); 643int minIterations = Math.Min(node.M, MaxLoopExpansion);
Stubs.cs (1)
47int length = Math.Min(span.Length, other.Length);
System.Threading (2)
System\Threading\Barrier.cs (2)
874int waitTime = totalTimeout == Timeout.Infinite ? maxWait : Math.Min(maxWait, totalTimeout); 888maxWait = maxWait >= waitTimeCeiling ? waitTimeCeiling : Math.Min(maxWait << 1, waitTimeCeiling);
System.Threading.Channels (1)
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (1)
111int newSegmentSize = Math.Min(_tail._array.Length * 2, MaxSegmentSize);
System.Threading.Tasks.Dataflow (1)
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (1)
111int newSegmentSize = Math.Min(_tail._array.Length * 2, MaxSegmentSize);
System.Threading.Tasks.Parallel (1)
System\Threading\Tasks\Parallel.cs (1)
116rval = (rval == -1) ? schedulerMax : Math.Min(schedulerMax, rval);
System.Windows.Controls.Ribbon (12)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGalleryItemsPanel.cs (12)
368columnCount = Math.Min(Math.Max(minColumnCount, Math.Min((int)(availableSize.Width / maxColumnWidth), childrenCount)), maxColumnCount); 380columnCount = Math.Min(Math.Max(minColumnCount, Math.Min((int)(availableSize.Width / maxColumnWidth), childrenCount)), maxColumnCount); 387columnCount = Math.Min(Math.Max(minColumnCount, Math.Min((int)(availableSize.Width / arrangeWidth), childrenCount)), maxColumnCount); 396columnCount = Math.Min(Math.Max(minColumnCount, Math.Min((int)(availableSize.Width / maxColumnWidth), childrenCount)), maxColumnCount); 403columnCount = Math.Min(Math.Max(minColumnCount, Math.Min((int)(availableSize.Width / _arrangeWidth), childrenCount)), maxColumnCount); 410columnCount = Math.Max(minColumnCount, Math.Min(childrenCount, maxColumnCount)); 572finalColumnCount = Math.Max(minColumnCount, Math.Min((int)(finalSize.Width / arrangeWidth), maxColumnCount));
UIAutomationClientSideProviders (10)
MS\Internal\AutomationProxies\WindowsEditBox.cs (2)
370clientLocation.x = Math.Min(clientLocation.x, clientRect.right); 372clientLocation.y = Math.Min(clientLocation.y, clientRect.bottom);
MS\Internal\AutomationProxies\WindowsEditBoxRange.cs (5)
134End = Math.Min(Math.Max(End, Start + 1), text.Length); 168End = Math.Min(Math.Max(End, Start + 1), text.Length); 302return text.Substring(Start, maxLength >= 0 ? Math.Min(Length, maxLength) : Length); 830moved = Math.Min(count, limit - index); 875moved = Math.Min(count, lineMax - line - 1);
MS\Internal\AutomationProxies\WindowsListViewItem.cs (1)
951clickPoint.x = Math.Min ((itemRectangle.left + 5), (itemRectangle.left + itemRectangle.right) / 2);
MS\Internal\AutomationProxies\WindowsRichEditRange.cs (2)
82_range.SetRange(Math.Max(charRange.Start, paraRange.Start), Math.Min(charRange.End, paraRange.End)); 166int end = Math.Min(_range.End, visibleRange.End);
UIAutomationTypes (2)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsCLR.cs (2)
5941int count = Math.Min(bytes.Length, buffer.Length - offset); 5997int count = Math.Min(s.Length, buffer.Length - offset);
WasmAppBuilder (1)
EmccCompile.cs (1)
133int allowedParallelism = DisableParallelCompile ? 1 : Math.Min(SourceFiles.Length, Environment.ProcessorCount);
WindowsFormsIntegration (4)
System\Windows\Integration\ElementHost.cs (2)
320int maxWidth = Math.Min(priorMaxSize.Width, maxElementSize.Width); 321int maxHeight = Math.Min(priorMaxSize.Height, maxElementSize.Height);
System\Windows\Integration\HostUtils.cs (2)
84Math.Min(size1.Width, size2.Width), 85Math.Min(size1.Height, size2.Height));