Skip to content

Commit

Permalink
perf: optimize package search cache
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraZiling committed Apr 15, 2024
1 parent f51d269 commit 2742278
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/PipManager.PackageSearch/IPackageSearchService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ namespace PipManager.PackageSearch;

public interface IPackageSearchService
{
public Task<QueryWrapper> Query(string name, int page = 1);
public ValueTask<QueryWrapper> Query(string name, int page = 1);
}
2 changes: 1 addition & 1 deletion src/PipManager.PackageSearch/PackageSearchService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class PackageSearchService(HttpClient httpClient) : IPackageSearchService
{
private Dictionary<(string, int), QueryWrapper> QueryCaches { get; } = [];

public async Task<QueryWrapper> Query(string name, int page = 1)
public async ValueTask<QueryWrapper> Query(string name, int page = 1)
{
if (QueryCaches.ContainsKey((name, page)))
{
Expand Down

0 comments on commit 2742278

Please sign in to comment.