Skip to content

Commit fb1d003

Browse files
authored
Code Quality: Use concrete types when possible for improved performance (#15093)
1 parent 030198d commit fb1d003

File tree

12 files changed

+14
-14
lines changed

12 files changed

+14
-14
lines changed

src/Files.App/Data/Factories/ShellContextFlyoutHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ bool filterMenuItemsImpl(string menuItem) => !string.IsNullOrEmpty(menuItem)
6666
}
6767

6868
private static void LoadMenuFlyoutItem(
69-
IList<ContextMenuFlyoutItemViewModel> menuItemsListLocal,
69+
List<ContextMenuFlyoutItemViewModel> menuItemsListLocal,
7070
ContextMenu contextMenu,
7171
IEnumerable<Win32ContextMenuItem> menuFlyoutItems,
7272
CancellationToken cancellationToken,

src/Files.App/Data/Models/ItemViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public sealed class ItemViewModel : ObservableObject, IDisposable
3939
private readonly AsyncManualResetEvent gitChangedEvent;
4040
private readonly DispatcherQueue dispatcherQueue;
4141
private readonly JsonElement defaultJson = JsonSerializer.SerializeToElement("{}");
42-
private readonly IStorageCacheController fileListCache = StorageCacheController.GetInstance();
42+
private readonly StorageCacheController fileListCache = StorageCacheController.GetInstance();
4343
private readonly string folderTypeTextLocalized = "Folder".GetLocalizedResource();
4444

4545
private Task? aProcessQueueAction;

src/Files.App/Services/UpdateService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Files.App.Services
1616
internal sealed class UpdateService : ObservableObject, IUpdateService
1717
{
1818
private StoreContext? _storeContext;
19-
private IList<StorePackageUpdate>? _updatePackages;
19+
private List<StorePackageUpdate>? _updatePackages;
2020

2121
private bool IsMandatory => _updatePackages?.Where(e => e.Mandatory).ToList().Count >= 1;
2222

src/Files.App/Utils/RecycleBin/RecycleBinManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public sealed class RecycleBinManager
1212
{
1313
private static readonly Lazy<RecycleBinManager> lazy = new(() => new RecycleBinManager());
1414

15-
private IList<SystemIO.FileSystemWatcher>? binWatchers;
15+
private List<SystemIO.FileSystemWatcher>? binWatchers;
1616

1717
public event SystemIO.FileSystemEventHandler? RecycleBinItemCreated;
1818

src/Files.App/Utils/Storage/Collection/BulkConcurrentObservableCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ public void Order(Func<List<T>, IEnumerable<T>> func)
487487

488488
public void OrderOne(Func<List<T>, IEnumerable<T>> func, T item)
489489
{
490-
IList<T> result;
490+
List<T> result;
491491
lock (syncRoot)
492492
{
493493
result = func.Invoke(collection).ToList();

src/Files.App/Utils/Storage/Collection/ConcurrentCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public void Order(Func<List<T>, IEnumerable<T>> func)
243243

244244
public void OrderOne(Func<List<T>, IEnumerable<T>> func, T item)
245245
{
246-
IList<T> result;
246+
List<T> result;
247247

248248
lock (syncRoot)
249249
{

src/Files.App/Utils/Storage/Enumerators/Win32StorageEnumerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static class Win32StorageEnumerator
1717

1818
private static readonly string folderTypeTextLocalized = "Folder".GetLocalizedResource();
1919

20-
private static readonly IStorageCacheController fileListCache = StorageCacheController.GetInstance();
20+
private static readonly StorageCacheController fileListCache = StorageCacheController.GetInstance();
2121

2222
public static async Task<List<ListedItem>> ListEntries(
2323
string path,

src/Files.App/Utils/Storage/Operations/FilesystemHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public sealed class FilesystemHelpers : IFilesystemHelpers
2424

2525
private IShellPage associatedInstance;
2626
private readonly IJumpListService jumpListService;
27-
private IFilesystemOperations filesystemOperations;
27+
private ShellFilesystemOperations filesystemOperations;
2828

2929
private ItemManipulationModel? itemManipulationModel => associatedInstance.SlimContentPage?.ItemManipulationModel;
3030

src/Files.App/Utils/Storage/StorageItems/ZipStorageFolder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ private static bool CheckAccess(Stream stream)
517517
return false;
518518
}
519519
}
520-
private static async Task<bool> CheckAccess(IStorageFile file)
520+
private static async Task<bool> CheckAccess(BaseStorageFile file)
521521
{
522522
return await SafetyExtensions.IgnoreExceptions(async () =>
523523
{

src/Files.App/ViewModels/Properties/CompatibilityViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public bool SetCompatibilityOptions()
116116
return WindowsCompatibilityService.SetCompatibilityOptionsForPath(ItemPath, CompatibilityOptions);
117117
}
118118

119-
private Task ExecuteRunTroubleshooterCommand()
119+
private Task<bool> ExecuteRunTroubleshooterCommand()
120120
{
121121
return LaunchHelper.RunCompatibilityTroubleshooterAsync(ItemPath);
122122
}

0 commit comments

Comments
 (0)