Skip to content

Commit 0503f7d

Browse files
committed
Rerun dotnet format after manual fixes
1 parent cc00cab commit 0503f7d

File tree

10 files changed

+21
-25
lines changed

10 files changed

+21
-25
lines changed

src/BizHawk.Client.Common/Api/ClientWebSocketWrapper.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public readonly Task<WebSocketReceiveResult> Receive(ArraySegment<byte> buffer,
3838
?? throw new ObjectDisposedException(nameof(_w));
3939

4040
/// <summary>calls <see cref="ClientWebSocket.ReceiveAsync"/></summary>
41-
public string Receive(int bufferCap, CancellationToken? cancellationToken = null)
41+
public readonly string Receive(int bufferCap, CancellationToken? cancellationToken = null)
4242
{
4343
if (_w == null) throw new ObjectDisposedException(nameof(_w));
4444
var buffer = new byte[bufferCap];
@@ -52,7 +52,7 @@ public readonly Task Send(ArraySegment<byte> buffer, WebSocketMessageType messag
5252
?? throw new ObjectDisposedException(nameof(_w));
5353

5454
/// <summary>calls <see cref="ClientWebSocket.SendAsync"/></summary>
55-
public Task Send(string message, bool endOfMessage, CancellationToken? cancellationToken = null)
55+
public readonly Task Send(string message, bool endOfMessage, CancellationToken? cancellationToken = null)
5656
{
5757
if (_w == null) throw new ObjectDisposedException(nameof(_w));
5858
return Send(

src/BizHawk.Client.Common/tools/Watch/Watch.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public static Watch GenerateWatch(MemoryDomain domain, long address, WatchSize s
150150
/// <returns>True if both watch are equals; otherwise, false</returns>
151151
public static bool operator ==(Watch a, Watch b)
152152
{
153-
if (ReferenceEquals(a, null) || ReferenceEquals(b, null))
153+
if (a is null || b is null)
154154
{
155155
return false;
156156
}
@@ -171,7 +171,7 @@ public static Watch GenerateWatch(MemoryDomain domain, long address, WatchSize s
171171
/// <returns>True if they are equals; otherwise, false</returns>
172172
public static bool operator ==(Watch a, Cheat b)
173173
{
174-
if (ReferenceEquals(a, null) || ReferenceEquals(b, null))
174+
if (a is null || b is null)
175175
{
176176
return false;
177177
}
@@ -325,7 +325,7 @@ public void ClearChangeCount()
325325
/// <returns>True if both object are equals; otherwise, false</returns>
326326
public bool Equals(Watch other)
327327
{
328-
if (ReferenceEquals(other, null))
328+
if (other is null)
329329
{
330330
return false;
331331
}
@@ -342,7 +342,7 @@ public bool Equals(Watch other)
342342
/// <returns>True if both object are equals; otherwise, false</returns>
343343
public bool Equals(Cheat other)
344344
{
345-
return !ReferenceEquals(other, null)
345+
return other is not null
346346
&& _domain == other.Domain
347347
&& Address == other.Address
348348
&& Size == other.Size;

src/BizHawk.Client.Common/tools/Watch/WatchList/WatchEqualityComparer.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ private class WatchEqualityComparer : IEqualityComparer<Watch>
1818
/// <returns>True if <see cref="Watch"/> are equal; otherwise, false</returns>
1919
public bool Equals(Watch x, Watch y)
2020
{
21-
if (ReferenceEquals(x, null))
21+
if (x is null)
2222
{
23-
return ReferenceEquals(y, null);
23+
return y is null;
2424
}
2525

26-
if (ReferenceEquals(y, null))
26+
if (y is null)
2727
{
2828
return false;
2929
}

src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/Cell.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public override int GetHashCode()
3737

3838
public static bool operator ==(Cell a, Cell b)
3939
{
40-
return a?.Equals(b) ?? ReferenceEquals(b, null);
40+
return a?.Equals(b) ?? b is null;
4141
}
4242

4343
public static bool operator !=(Cell a, Cell b)

src/BizHawk.Common/EndiannessUtils.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ public static void MutatingByteSwap32(Span<byte> a)
3131
fixed (byte* p = &a[0]) for (var i = 0; i < l; i += 4)
3232
{
3333
(p[i + 3], p[i]) = (p[i], p[i + 3]);
34-
var b = p[i + 1];
35-
p[i + 1] = p[i + 2];
36-
p[i + 2] = b;
37-
}
34+
(p[i + 2], p[i + 1]) = (p[i + 1], p[i + 2]);
35+
}
3836
#else
3937
Debug.Assert(a.Length % 4 == 0);
4038
var ints = MemoryMarshal.Cast<byte, uint>(a);

src/BizHawk.Emulation.Cores/CPUs/Z80A/Operations.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -651,9 +651,7 @@ public void ADDS_Func(ushort dest_l, ushort dest_h, ushort src_l, ushort src_h)
651651
public void EXCH_16_Func(ushort dest_l, ushort dest_h, ushort src_l, ushort src_h)
652652
{
653653
(Regs[src_l], Regs[dest_l]) = (Regs[dest_l], Regs[src_l]);
654-
var temp = Regs[dest_h];
655-
Regs[dest_h] = Regs[src_h];
656-
Regs[src_h] = temp;
654+
(Regs[src_h], Regs[dest_h]) = (Regs[dest_h], Regs[src_h]);
657655
}
658656

659657
public void SBC_16_Func(ushort dest_l, ushort dest_h, ushort src_l, ushort src_h)

src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Timing.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ private long CurrentCPUCycle
2828
}
2929
#pragma warning restore IDE0051
3030

31-
/// <summary>
32-
/// The last CPU cycle when the FDC accepted an IO read/write
33-
/// </summary>
34-
private long LastCPUCycle;
31+
/// <summary>
32+
/// The last CPU cycle when the FDC accepted an IO read/write
33+
/// </summary>
34+
private long LastCPUCycle;
3535

3636
/// <summary>
3737
/// The current delay figure (in Z80 t-states)

src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ private struct CommStruct
346346

347347
//utilities
348348
//TODO: make internal, wrap on the API instead of the comm
349-
public string GetAscii() => _getAscii(str);
349+
public readonly string GetAscii() => _getAscii(str);
350350
public readonly bool GetBool() { return value != 0; }
351351

352352
private readonly string _getAscii(sbyte* ptr)

src/BizHawk.Emulation.DiscSystem/DiscSubQ.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public struct SubchannelQ
9191
/// Retrieves the initial set of timestamps (min,sec,frac) as a convenient Timestamp
9292
/// </summary>
9393
public int Timestamp {
94-
get => MSF.ToInt(min.DecimalValue, sec.DecimalValue, frame.DecimalValue);
94+
readonly get => MSF.ToInt(min.DecimalValue, sec.DecimalValue, frame.DecimalValue);
9595
set {
9696
var ts = new Timestamp(value);
9797
min.DecimalValue = ts.MIN; sec.DecimalValue = ts.SEC; frame.DecimalValue = ts.FRAC;
@@ -103,7 +103,7 @@ public int Timestamp {
103103
/// TODO - rename everything AP here, it's nonsense. (the P is)
104104
/// </summary>
105105
public int AP_Timestamp {
106-
get => MSF.ToInt(ap_min.DecimalValue, ap_sec.DecimalValue, ap_frame.DecimalValue);
106+
readonly get => MSF.ToInt(ap_min.DecimalValue, ap_sec.DecimalValue, ap_frame.DecimalValue);
107107
set {
108108
var ts = new Timestamp(value);
109109
ap_min.DecimalValue = ts.MIN; ap_sec.DecimalValue = ts.SEC; ap_frame.DecimalValue = ts.FRAC;

src/BizHawk.Emulation.DiscSystem/DiscTypes.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public readonly bool Equals(BCD2 other)
3434
return BCDValue == other.BCDValue;
3535
}
3636

37-
public override bool Equals(object obj)
37+
public override readonly bool Equals(object obj)
3838
{
3939
return obj is BCD2 other && Equals(other);
4040
}

0 commit comments

Comments
 (0)