Skip to content

Commit 7603af6

Browse files
format
1 parent 72ecb73 commit 7603af6

19 files changed

Lines changed: 79 additions & 96 deletions

File tree

Communication/ComTransport.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void Handler(string data)
8989
DataReceived += Handler;
9090

9191
var timer = new Timer(_ =>
92-
tcs.TrySetException(new TimeoutException()),
92+
tcs.TrySetException(new TimeoutException()),
9393
null,
9494
timeout,
9595
Timeout.InfiniteTimeSpan);

Communication/Interfaces/IComTransport.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,4 @@ public interface IComTransport
2727
/// </summary>
2828
event Action<string> DataReceived;
2929
}
30-
3130
}

CoreBuilder/UI/LogWindow.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6-
xmlns:local="clr-namespace:CoreBuilder.UI"
76
mc:Ignorable="d"
87
Title="Log Window" Height="450" Width="800">
98
<DockPanel>

CoreBuilder/WhoAmI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public CommandResult Execute(params string[] args)
5555
.ToList();
5656

5757
var info =
58-
$"WhoAmI System Report\n" +
59-
$"------------------------\n" +
58+
"WhoAmI System Report\n" +
59+
"------------------------\n" +
6060
$"Hostname: {hostname}\n" +
6161
$"Username: {username}\n" +
6262
$"Domain: {domain}\n" +

CoreMemoryLog/DebugLogger.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
namespace CoreMemoryLog
1919
{
20-
2120
/// <summary>
2221
/// Provides a static, debug-only logging wrapper that is **entirely removed**
2322
/// from Release builds using <see cref="ConditionalAttribute"/>.

CoreMemoryLog/LogResources.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal static class LogResources
2121
/// <summary>
2222
/// The TimeStamp (const). Value: "Timestamp"
2323
/// </summary>
24-
internal const string TimeStamp= "Timestamp";
24+
internal const string TimeStamp = "Timestamp";
2525

2626
/// <summary>
2727
/// The LibraryName (const). Value: "LibraryName"

ExtendedSystemObjects/FastLinq.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public static class FastLinq
2525
/// <param name="action">The action to execute on each element.</param>
2626
public static void ForEachFast<T>(this ReadOnlySpan<T> span, Action<T> action)
2727
{
28-
for (int i = 0; i < span.Length; i++)
29-
action(span[i]);
28+
foreach (var t in span)
29+
action(t);
3030
}
3131

3232
/// <summary>
@@ -38,8 +38,8 @@ public static void ForEachFast<T>(this ReadOnlySpan<T> span, Action<T> action)
3838
/// <param name="action">The action to execute on each element.</param>
3939
public static void ForEachFast<T>(this Span<T> span, Action<T> action)
4040
{
41-
for (int i = 0; i < span.Length; i++)
42-
action(span[i]);
41+
foreach (var t in span)
42+
action(t);
4343
}
4444

4545
/// <summary>
@@ -78,9 +78,10 @@ public static int WhereFast<T>(
7878
Func<T, bool> predicate)
7979
{
8080
int count = 0;
81-
for (int i = 0; i < span.Length; i++)
82-
if (predicate(span[i]))
83-
destination[count++] = span[i];
81+
foreach (var t in span)
82+
if (predicate(t))
83+
destination[count++] = t;
84+
8485
return count;
8586
}
8687

@@ -99,8 +100,9 @@ public static TResult AggregateFast<T, TResult>(
99100
Func<TResult, T, TResult> func)
100101
{
101102
var acc = seed;
102-
for (int i = 0; i < span.Length; i++)
103-
acc = func(acc, span[i]);
103+
foreach (var t in span)
104+
acc = func(acc, t);
105+
104106
return acc;
105107
}
106108

@@ -126,9 +128,10 @@ public static bool AnyFast<T>(this ReadOnlySpan<T> span)
126128
/// <returns>True if all elements satisfy the predicate; otherwise false.</returns>
127129
public static bool AllFast<T>(this ReadOnlySpan<T> span, Func<T, bool> predicate)
128130
{
129-
for (int i = 0; i < span.Length; i++)
130-
if (!predicate(span[i]))
131+
foreach (var t in span)
132+
if (!predicate(t))
131133
return false;
134+
132135
return true;
133136
}
134137

FileHandler/FileHandleCompress.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ await Task.Run(() =>
7373
if (!delete)
7474
return true;
7575

76-
var deleteTasks = fileToAdd.Select(file => FileHandleDelete.DeleteFile(file));
76+
var deleteTasks = fileToAdd.Select(FileHandleDelete.DeleteFile);
7777
var results = await Task.WhenAll(deleteTasks);
7878

7979
return results.All(r => r);
@@ -163,7 +163,7 @@ public static async Task<bool> SaveZipTransactional(
163163

164164
if (!delete) return true;
165165

166-
var deleteTasks = filesToAdd.Select(file => FileHandleDelete.DeleteFile(file));
166+
var deleteTasks = filesToAdd.Select(FileHandleDelete.DeleteFile);
167167
var results = await Task.WhenAll(deleteTasks);
168168

169169
return results.All(r => r);

FileHandler/FileHandleSearch.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ public static List<string> GetAllFiles(string path, bool subdirectories)
124124
/// </summary>
125125
/// <param name="files">The files.</param>
126126
/// <returns>File Details</returns>
127-
public static List<FileDetails> GetFilesDetails(List<string> files)
127+
public static List<FileDetails> GetFilesDetails(List<string>? files)
128128
{
129129
if (files == null || files.Count == 0)
130130
return new List<FileDetails>();
131131

132-
return files.Select(GetFileDetails).Where(f => f != null)!.ToList()!;
132+
return files.Select(GetFileDetails).Where(f => f != null).ToList()!;
133133
}
134134

135135
/// <summary>

Imaging/ImageGif.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ public void StartGif()
157157

158158
const int delay = 80;
159159

160-
_dispatcherTimer = new DispatcherTimer();
161-
_dispatcherTimer.Interval = TimeSpan.FromMilliseconds(delay);
160+
_dispatcherTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(delay) };
162161
_dispatcherTimer.Tick += (s, e) =>
163162
{
164163
if (_decoder == null)

0 commit comments

Comments
 (0)