Removed unecessary second calls to retrieve the file system in TemplateRepository.

This commit is contained in:
Andy Butland
2021-05-12 14:53:43 +02:00
parent fd9faf5a99
commit 01643e494a

View File

@@ -442,15 +442,15 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement
public Stream GetFileContentStream(string filepath)
{
IFileSystem fs = GetFileSystem(filepath);
if (fs.FileExists(filepath) == false)
IFileSystem fileSystem = GetFileSystem(filepath);
if (fileSystem.FileExists(filepath) == false)
{
return null;
}
try
{
return GetFileSystem(filepath).OpenFile(filepath);
return fileSystem.OpenFile(filepath);
}
catch
{
@@ -462,14 +462,15 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement
public long GetFileSize(string filename)
{
if (GetFileSystem(filename).FileExists(filename) == false)
IFileSystem fileSystem = GetFileSystem(filename);
if (fileSystem.FileExists(filename) == false)
{
return -1;
}
try
{
return GetFileSystem(filename).GetSize(filename);
return fileSystem.GetSize(filename);
}
catch
{