Skip to content

Commit

Permalink
Remove comment in ZipFile.Create.cs (#86927)
Browse files Browse the repository at this point in the history
* Remove comment in ZipFile.Create.cs

In #85491 the stream-based version of the `DoCreateFromDirectory` override copy-pasted comments from the string-based version
```csharp
// Rely on Path.GetFullPath for validation of sourceDirectoryName and destinationArchive
```
The last clause of that comment is not relevant in the stream-based version (the argument is `Stream destination`) so deleted that clause.

It's possible that the other comment is also misleading as we test the `compressionLevel ` argument just above (unlike in the `String destinationArchive` version
```csharp
            // Checking of compressionLevel is passed down to DeflateStream and the IDeflater implementation
            // as it is a pluggable component that completely encapsulates the meaning of compressionLevel.
```

* Remove compressionLevel validation comment

Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>

---------

Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
  • Loading branch information
IDisposable and carlossanlop authored May 31, 2023
1 parent 9628be4 commit aca0eab
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,7 @@ private static void DoCreateFromDirectory(string sourceDirectoryName, Stream des
throw new ArgumentOutOfRangeException(nameof(compressionLevel));
}

// Rely on Path.GetFullPath for validation of sourceDirectoryName and destinationArchive

// Checking of compressionLevel is passed down to DeflateStream and the IDeflater implementation
// as it is a pluggable component that completely encapsulates the meaning of compressionLevel.
// Rely on Path.GetFullPath for validation of sourceDirectoryName

sourceDirectoryName = Path.GetFullPath(sourceDirectoryName);

Expand Down

0 comments on commit aca0eab

Please sign in to comment.