Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redundant ParseReference call #164

Closed
1 task done
Wwwsylvia opened this issue Nov 19, 2024 · 0 comments · Fixed by #165
Closed
1 task done

Redundant ParseReference call #164

Wwwsylvia opened this issue Nov 19, 2024 · 0 comments · Fixed by #165
Labels
bug Something isn't working triage New issues or PRs to be acknowledged by maintainers

Comments

@Wwwsylvia
Copy link
Member

What happened in your code base?

There are redundant ParseReference calls in the current code base:

public async Task PushAsync(Descriptor expected, Stream content, string reference, CancellationToken cancellationToken = default)
{
var contentReference = Repository.ParseReference(reference).ContentReference!;
await InternalPushAsync(expected, content, contentReference, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Pushes the manifest content, matching the expected descriptor.
/// </summary>
/// <param name="expected"></param>
/// <param name="stream"></param>
/// <param name="contentReference"></param>
/// <param name="cancellationToken"></param>
private async Task InternalPushAsync(Descriptor expected, Stream stream, string contentReference, CancellationToken cancellationToken)
{
var remoteReference = Repository.ParseReference(contentReference);

What did you expect to happen?

We should refactor the code to avoid the redundant call

How can we reproduce it?

N/A

What is the version or commit of the ORAS .NET library?

v0.2.0

What are your OS and Runtime environments?

Ubuntu 24.04

Are you willing to submit PRs to fix it?

  • Yes, I am willing to fix it.
@Wwwsylvia Wwwsylvia added bug Something isn't working triage New issues or PRs to be acknowledged by maintainers labels Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues or PRs to be acknowledged by maintainers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant