Simplify GetFileContentsAsync by using lamda
This commit is contained in:
parent
ebf1776397
commit
dbd2384d43
1 changed files with 2 additions and 4 deletions
|
@ -97,10 +97,8 @@ namespace Microsoft.DotNet.SourceBuild.Tasks.UsageReport
|
||||||
/// <param name="relativeFilePath">The relative path (from the git root) to the file.</param>
|
/// <param name="relativeFilePath">The relative path (from the git root) to the file.</param>
|
||||||
/// <param name="commitSha">The commit sha for the version of the file to get.</param>
|
/// <param name="commitSha">The commit sha for the version of the file to get.</param>
|
||||||
/// <returns>The contents of the specified file.</returns>
|
/// <returns>The contents of the specified file.</returns>
|
||||||
private async Task<string> GetFileContentsAsync(string relativeFilePath, string commitSha)
|
private Task<string> GetFileContentsAsync(string relativeFilePath, string commitSha) =>
|
||||||
{
|
client.GetStringAsync($"https://raw.githubusercontent.com/dotnet/source-build/{commitSha}/{relativeFilePath.Replace('\\', '/')}");
|
||||||
return await client.GetStringAsync($"https://raw.githubusercontent.com/dotnet/source-build/{commitSha}/{relativeFilePath.Replace('\\', '/')}");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Executes a git command and returns the result.
|
/// Executes a git command and returns the result.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue