Skip to content

Remove duplicate MakeSeekable method from SymbolValidator - #1281

Merged
clairernovotny merged 1 commit into
NuGetPackageExplorer:mainfrom
campersau:makeseekabledup
May 26, 2021
Merged

clairernovotny merged 1 commit into
NuGetPackageExplorer:mainfrom
campersau:makeseekabledup

Conversation

@campersau

Copy link
Copy Markdown
Collaborator

Implementation looks identical to:

public static Stream MakeSeekable(Stream stream, bool disposeOriginal = false)
{
if (stream is null)
throw new System.ArgumentNullException(nameof(stream));
if (stream.CanSeek)
{
return stream;
}
var memoryStream = new MemoryStream();
stream.CopyTo(memoryStream);
memoryStream.Position = 0;
if (disposeOriginal)
{
stream.Dispose();
}
return memoryStream;
}

Also StreamUtility.MakeSeekable was already used here:

using var stream = StreamUtility.MakeSeekable(file.GetStream(), disposeOriginal: true);

@clairernovotny

Copy link
Copy Markdown
Member

strange, not sure why that was even there 🤷‍♀️

@clairernovotny
clairernovotny merged commit 4c9304d into NuGetPackageExplorer:main May 26, 2021
@campersau
campersau deleted the makeseekabledup branch May 26, 2021 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants