From 01643e494a5eb0de1d3c3da1ea1bfd641069b109 Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Wed, 12 May 2021 14:53:43 +0200 Subject: [PATCH] Removed unecessary second calls to retrieve the file system in TemplateRepository. --- .../Repositories/Implement/TemplateRepository.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/TemplateRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/TemplateRepository.cs index 37eb9fab79..4e4f52c93a 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/TemplateRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/TemplateRepository.cs @@ -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 {