Skip to content

Commit

Permalink
Refactor Build method return type in CacheDependencyKeyBuilder
Browse files Browse the repository at this point in the history
This commit updates the `Build` method in the `CacheDependencyKeyBuilder` class, changing its return type from `IEnumerable<string>` to `string[]`. This change necessitates updating the method's implementation to return `_keys.ToArray()` to match the new return type. The modification aims to improve performance, ensure type consistency, and align with other parts of the codebase expecting an array return type. Other methods, including `AddPath` and `ForContentItem`, remain unchanged, maintaining their roles in configuring cache dependency keys.
  • Loading branch information
bluemodus-brandon committed Jul 10, 2024
1 parent 7e4355f commit b3aa543
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public CacheDependencyKeyBuilder AddPath(string path)
return AddKey($"bypath|{path}");
}

public IEnumerable<string> Build()
public string[] Build()
{
return _keys;
return _keys.ToArray();
}

public CacheDependencyKeyBuilder ForContentItem()
Expand Down

0 comments on commit b3aa543

Please sign in to comment.