aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/IO
diff options
context:
space:
mode:
authorignacio laborde <laborde.ignacio@gmail.com>2022-01-04 13:05:36 -0300
committerjgriff6 <74262798+jgriff6@users.noreply.github.com>2022-10-25 00:38:57 +0100
commitc6bf6e00de5906844396bee59e9e891b2903815e (patch)
tree010d6bd046dea9f8e0cbd7268593e19b8271cd74 /Emby.Server.Implementations/IO
parent790f67aac11e5c32bad19126d4e35b2afa259006 (diff)
Remove unnecessary ToList usage
Diffstat (limited to 'Emby.Server.Implementations/IO')
-rw-r--r--Emby.Server.Implementations/IO/LibraryMonitor.cs16
1 files changed, 5 insertions, 11 deletions
diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.cs
index 657daac3f..341d67b8a 100644
--- a/Emby.Server.Implementations/IO/LibraryMonitor.cs
+++ b/Emby.Server.Implementations/IO/LibraryMonitor.cs
@@ -82,9 +82,7 @@ namespace Emby.Server.Implementations.IO
public bool IsPathLocked(string path)
{
// This method is not used by the core but it used by auto-organize
-
- var lockedPaths = _tempIgnoredPaths.Keys.ToList();
- return lockedPaths.Any(i => _fileSystem.AreEqual(i, path) || _fileSystem.ContainsSubPath(i, path));
+ return _tempIgnoredPaths.Keys.Any(i => _fileSystem.AreEqual(i, path) || _fileSystem.ContainsSubPath(i, path));
}
public async void ReportFileSystemChangeComplete(string path, bool refreshPath)
@@ -145,8 +143,7 @@ namespace Emby.Server.Implementations.IO
.OfType<Folder>()
.SelectMany(f => f.PhysicalLocations)
.Distinct(StringComparer.OrdinalIgnoreCase)
- .OrderBy(i => i)
- .ToList();
+ .OrderBy(i => i);
foreach (var path in paths)
{
@@ -372,11 +369,8 @@ namespace Emby.Server.Implementations.IO
var monitorPath = !IgnorePatterns.ShouldIgnore(path);
- // Ignore certain files
- var tempIgnorePaths = _tempIgnoredPaths.Keys.ToList();
-
- // If the parent of an ignored path has a change event, ignore that too
- if (tempIgnorePaths.Any(i =>
+ // Ignore certain files, If the parent of an ignored path has a change event, ignore that too
+ if (_tempIgnoredPaths.Keys.Any(i =>
{
if (_fileSystem.AreEqual(i, path))
{
@@ -491,7 +485,7 @@ namespace Emby.Server.Implementations.IO
{
lock (_activeRefreshers)
{
- foreach (var refresher in _activeRefreshers.ToList())
+ foreach (var refresher in _activeRefreshers)
{
refresher.Completed -= OnNewRefresherCompleted;
refresher.Dispose();