Code Cleanup

Make fields readonly
Remove unnecessary casts
Format document
Remove unnecessary usings
Sort usings
Use file-level namespaces
Order modifiers
This commit is contained in:
Michael Bucari-Tovo
2026-02-05 12:48:44 -07:00
parent d67692355f
commit 3ab1edc076
325 changed files with 18850 additions and 19145 deletions

View File

@@ -68,7 +68,7 @@ public static class FilePathCache
public static List<(FileType fileType, LongPath path)> GetFiles(string id)
{
List<CacheEntry> matchingFiles;
lock(locker)
lock (locker)
matchingFiles = Cache.GetIdEntries(id);
bool cacheChanged = false;
@@ -150,7 +150,7 @@ public static class FilePathCache
public static void Insert(CacheEntry entry)
{
lock(locker)
lock (locker)
Cache.Add(entry.Id, entry);
Inserted?.Invoke(null, entry);
save();
@@ -182,7 +182,7 @@ public static class FilePathCache
{
[JsonProperty]
private readonly ConcurrentDictionary<string, HashSet<TEntry>> Dictionary = new();
private static object lockObject = new();
private static readonly object lockObject = new();
public List<string> GetIDs() => Dictionary.Keys.ToList();