Skip to content

Commit

Permalink
Merge pull request #45 from mycroes/cleanup
Browse files Browse the repository at this point in the history
Cleanup this qualification where possible.
  • Loading branch information
mycroes authored Jan 27, 2025
2 parents 31ece13 + 4632152 commit ae88509
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Sally7.Benchmarks/ConverterLookup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ private class DataItemWithConverter<T>

public DataItemWithConverter(Func<byte[], T> converter)
{
this._converter = converter;
_converter = converter;
}

public T? Value { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Sally7.Tests/Protocol/CommunicationSequence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal class CommunicationSequence

public CommunicationSequence(ITestOutputHelper output)
{
this._output = output;
_output = output;
}

public CommunicationSequence AddCall(byte[] request, byte[] response)
Expand Down
2 changes: 1 addition & 1 deletion Sally7.Tests/Protocol/CommunicationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class CommunicationTests

public CommunicationTests(ITestOutputHelper output)
{
this._output = output;
_output = output;
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion Sally7/DataBlockDataItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public DataBlockDataItem(BigEndianShort dbNumber, int startByte, int bit, int le
public TValue? Value
{
get => _value;
set => this._value = value;
set => _value = value;
}

public Address Address { get; }
Expand Down
4 changes: 2 additions & 2 deletions Sally7/Internal/SocketAwaitable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public SocketAwaitable GetAwaiter()

public void OnCompleted(Action continuation)
{
if (this._continuation == Sentinel ||
Interlocked.CompareExchange(ref this._continuation, continuation, null) == Sentinel)
if (_continuation == Sentinel ||
Interlocked.CompareExchange(ref _continuation, continuation, null) == Sentinel)
{
continuation.Invoke();
}
Expand Down
2 changes: 1 addition & 1 deletion Sally7/Internal/SocketTpktReader.desktop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal partial class SocketTpktReader

public SocketTpktReader(Socket socket)
{
this._socket = socket;
_socket = socket;
_args = new SocketAsyncEventArgs();
_awaitable = new SocketAwaitable(_args);
}
Expand Down
2 changes: 1 addition & 1 deletion Sally7/Internal/SocketTpktReader.netcore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Sally7.Internal
{
internal partial class SocketTpktReader
{
public SocketTpktReader(Socket socket) => this._socket = socket;
public SocketTpktReader(Socket socket) => _socket = socket;

public async ValueTask<int> ReadAsync(Memory<byte> message, CancellationToken cancellationToken)
{
Expand Down
2 changes: 1 addition & 1 deletion Sally7/RequestExecutor/ConcurrentRequestExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public ConcurrentRequestExecutor(S7Connection connection, MemoryPool<byte>? memo
_socket = connection.TcpClient.Client;
_bufferSize = connection.Parameters.GetRequiredBufferSize();
_maxRequests = connection.Parameters.MaximumNumberOfConcurrentRequests;
this._memoryPool = memoryPool ?? MemoryPool<byte>.Shared;
_memoryPool = memoryPool ?? MemoryPool<byte>.Shared;

_jobPool = new JobPool(connection.Parameters.MaximumNumberOfConcurrentRequests);
_sendSignal = new Signal();
Expand Down
8 changes: 4 additions & 4 deletions Sally7/RequestExecutor/Request.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal class Request : INotifyCompletion, IDisposable

public void Complete(int length)
{
this._length = length;
_length = length;
IsCompleted = true;

InvokeContinuation();
Expand All @@ -38,8 +38,8 @@ public Memory<byte> GetResult()

public void OnCompleted(Action continuation)
{
if (this._continuation == Sentinel ||
Interlocked.CompareExchange(ref this._continuation, continuation, null) == Sentinel)
if (_continuation == Sentinel ||
Interlocked.CompareExchange(ref _continuation, continuation, null) == Sentinel)
{
continuation.Invoke();
}
Expand All @@ -53,7 +53,7 @@ public void Reset()

public void SetBuffer(Memory<byte> buffer)
{
this._buffer = buffer;
_buffer = buffer;
}

public void Dispose()
Expand Down
22 changes: 11 additions & 11 deletions Sally7/S7Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ public TimeSpan RequestTimeout
/// </param>
public S7Connection(string host, Tsap sourceTsap, Tsap destinationTsap, MemoryPool<byte>? memoryPool = default, RequestExecutorFactory? executorFactory = default)
{
this._host = host;
this._sourceTsap = sourceTsap;
this._destinationTsap = destinationTsap;
this._memoryPool = memoryPool;
this._executorFactory = executorFactory ?? DefaultRequestExecutorFactory;
_host = host;
_sourceTsap = sourceTsap;
_destinationTsap = destinationTsap;
_memoryPool = memoryPool;
_executorFactory = executorFactory ?? DefaultRequestExecutorFactory;
}

/// <summary>
Expand All @@ -103,12 +103,12 @@ public S7Connection(string host, Tsap sourceTsap, Tsap destinationTsap, MemoryPo
public S7Connection(string host, int port, Tsap sourceTsap, Tsap destinationTsap, MemoryPool<byte>? memoryPool = default,
RequestExecutorFactory? executorFactory = default)
{
this._host = host;
this._port = port;
this._sourceTsap = sourceTsap;
this._destinationTsap = destinationTsap;
this._memoryPool = memoryPool;
this._executorFactory = executorFactory ?? DefaultRequestExecutorFactory;
_host = host;
_port = port;
_sourceTsap = sourceTsap;
_destinationTsap = destinationTsap;
_memoryPool = memoryPool;
_executorFactory = executorFactory ?? DefaultRequestExecutorFactory;
}

/// <summary>
Expand Down

0 comments on commit ae88509

Please sign in to comment.