Skip to content

Commit 5c43dd4

Browse files
committed
Code quality
1 parent c189336 commit 5c43dd4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Flow.Launcher.Infrastructure/Storage/BinaryStorage.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ private static async ValueTask<T> DeserializeAsync(Stream stream, T defaultData)
8282

8383
public void Save()
8484
{
85-
FilesFolders.ValidateDirectory(DirectoryPath); // User may delete the directory, so we need to check it
85+
// User may delete the directory, so we need to check it
86+
FilesFolders.ValidateDirectory(DirectoryPath);
87+
8688
var serialized = MemoryPackSerializer.Serialize(Data);
8789
File.WriteAllBytes(FilePath, serialized);
8890
}
@@ -103,7 +105,9 @@ public void ClearData()
103105
// so we need to pass it to SaveAsync
104106
public async ValueTask SaveAsync(T data)
105107
{
106-
FilesFolders.ValidateDirectory(DirectoryPath); // User may delete the directory, so we need to check it
108+
// User may delete the directory, so we need to check it
109+
FilesFolders.ValidateDirectory(DirectoryPath);
110+
107111
await using var stream = new FileStream(FilePath, FileMode.Create);
108112
await MemoryPackSerializer.SerializeAsync(stream, data);
109113
}

0 commit comments

Comments
 (0)