From fca3e027c217af8d78facae3da58ab82e1988a10 Mon Sep 17 00:00:00 2001 From: alinpahontu2912 Date: Fri, 31 Jul 2026 16:31:33 +0200 Subject: [PATCH] fix comment typos --- .../src/System/Formats/Tar/GnuSparseStream.cs | 9 ++++----- .../src/System/Formats/Tar/TarHeader.Write.cs | 2 +- .../System/IO/Compression/enc/BrotliEncoderOperation.cs | 2 +- .../src/System/IO/Compression/ZipBlocks.Async.cs | 2 +- .../src/System/IO/Compression/ZipBlocks.cs | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/libraries/System.Formats.Tar/src/System/Formats/Tar/GnuSparseStream.cs b/src/libraries/System.Formats.Tar/src/System/Formats/Tar/GnuSparseStream.cs index 81662e1f03e6b3..a14a28b95c8f92 100644 --- a/src/libraries/System.Formats.Tar/src/System/Formats/Tar/GnuSparseStream.cs +++ b/src/libraries/System.Formats.Tar/src/System/Formats/Tar/GnuSparseStream.cs @@ -52,8 +52,8 @@ internal GnuSparseStream(Stream rawStream, long realSize) _realSize = realSize; } - // Parses the sparse map on first read. Populates _segments, _packedStartOffsets, - // and _dataStart. Throws InvalidDataException if the sparse map is malformed. + // Parses the sparse map on first read. Populates _segments and _packedStartOffsets. + // Throws InvalidDataException if the sparse map is malformed. private async ValueTask EnsureInitializedCoreAsync(CancellationToken cancellationToken) where TAdapter : IReadWriteAdapter { @@ -152,8 +152,7 @@ public override long Seek(long offset, SeekOrigin origin) } _virtualPosition = newPosition; - // _currentSegmentIndex is not reset here; FindSegmentFromCurrent handles - // backward seeks using binary search. + // _currentSegmentIndex is not reset here; see the Position setter for why. return _virtualPosition; } @@ -330,7 +329,7 @@ private async ValueTask CopyPopulatedDataToCoreAsync(FileStream destin } // Reads from the packed data at the given packedOffset. - // After EnsureInitialized, the raw stream is positioned at _dataStart and + // After EnsureInitialized, the raw stream is positioned at the start of the packed data and // _nextPackedOffset tracks how far into the packed data we've read. // Returns the number of bytes actually read (may be less than destination.Length). private async ValueTask ReadFromPackedDataCoreAsync(Memory destination, long packedOffset, CancellationToken cancellationToken) diff --git a/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Write.cs b/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Write.cs index d6d435b1f491b4..c5e521e7cb1a47 100644 --- a/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Write.cs +++ b/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Write.cs @@ -531,7 +531,7 @@ private static int WritePosixMagicAndVersion(Span buffer) return checksum; } - // Writes the magic and vresion fields of a gnu entry into the specified spans. + // Writes the magic and version fields of a gnu entry into the specified spans. private static int WriteGnuMagicAndVersion(Span buffer) { int checksum = WriteLeftAlignedBytesAndGetChecksum(GnuMagicBytes, buffer.Slice(FieldLocations.Magic, FieldLengths.Magic)); diff --git a/src/libraries/System.IO.Compression.Brotli/src/System/IO/Compression/enc/BrotliEncoderOperation.cs b/src/libraries/System.IO.Compression.Brotli/src/System/IO/Compression/enc/BrotliEncoderOperation.cs index 5f7395fdc64863..769aa08d2d8827 100644 --- a/src/libraries/System.IO.Compression.Brotli/src/System/IO/Compression/enc/BrotliEncoderOperation.cs +++ b/src/libraries/System.IO.Compression.Brotli/src/System/IO/Compression/enc/BrotliEncoderOperation.cs @@ -7,7 +7,7 @@ namespace System.IO.Compression /// Process - Process input. Encoder may postpone producing output, until it has processed enough input. /// Flush - Produce output for all processed input. Actual flush is performed when input stream is depleted and there is enough space in output stream. /// Finish - Finalize the stream. Adding more input data to finalized stream is impossible. - /// EmitMetadata - Emit metadata block to stream. Stream is soft-flushed before metadata block is emitted. Metadata bloc MUST be no longer than 16MiB. + /// EmitMetadata - Emit metadata block to stream. Stream is soft-flushed before metadata block is emitted. Metadata block MUST be no longer than 16MiB. /// internal enum BrotliEncoderOperation { diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipBlocks.Async.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipBlocks.Async.cs index df2713cf50472f..df16459a293df2 100644 --- a/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipBlocks.Async.cs +++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipBlocks.Async.cs @@ -266,7 +266,7 @@ public static async Task ReadBlockAsync(Stream st if (!TryReadBlockInitialize(stream, blockContents, bytesRead, out ZipEndOfCentralDirectoryBlock? eocdBlock, out bool readComment)) { - // // We shouldn't get here becasue we found the eocd block using the signature finder + // We shouldn't get here because we found the EOCD block using the signature finder throw new InvalidDataException(SR.EOCDNotFound); } else if (readComment) diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipBlocks.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipBlocks.cs index 0ecf65adeba820..d33349a34b5dec 100644 --- a/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipBlocks.cs +++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipBlocks.cs @@ -1162,7 +1162,7 @@ public static unsafe ZipEndOfCentralDirectoryBlock ReadBlock(Stream stream) if (!TryReadBlockInitialize(stream, blockContents, bytesRead, out ZipEndOfCentralDirectoryBlock? eocdBlock, out bool readComment)) { - // // We shouldn't get here becasue we found the eocd block using the signature finder + // We shouldn't get here because we found the EOCD block using the signature finder throw new InvalidDataException(SR.EOCDNotFound); } else if (readComment)