Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
houseofcat committed Apr 23, 2024
1 parent fd877fd commit 6dece61
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/HouseofCat.Compression/BrotliProvider.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using HouseofCat.Utilities.Errors;
using CommunityToolkit.HighPerformance;
using CommunityToolkit.HighPerformance;
using HouseofCat.Utilities.Errors;
using System;
using System.IO;
using System.IO.Compression;
Expand Down
4 changes: 2 additions & 2 deletions src/HouseofCat.Compression/DeflateProvider.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using HouseofCat.Utilities.Errors;
using CommunityToolkit.HighPerformance;
using CommunityToolkit.HighPerformance;
using HouseofCat.Utilities.Errors;
using System;
using System.IO;
using System.IO.Compression;
Expand Down
4 changes: 2 additions & 2 deletions src/HouseofCat.Compression/GzipProvider.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using HouseofCat.Utilities.Errors;
using CommunityToolkit.HighPerformance;
using CommunityToolkit.HighPerformance;
using HouseofCat.Utilities.Errors;
using System;
using System.IO;
using System.IO.Compression;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using HouseofCat.Utilities;
using CommunityToolkit.HighPerformance;
using HouseofCat.Utilities;
using HouseofCat.Utilities.Errors;
using CommunityToolkit.HighPerformance;
using System;
using System.IO;
using System.IO.Compression;
Expand Down
4 changes: 2 additions & 2 deletions src/HouseofCat.Dataflows/ChannelBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class ChannelBlock<TOut> : ChannelReaderBlock<TOut>, IPropagatorBlock<TOu
{
protected readonly Channel<TOut> _channel;

public ChannelBlock(BoundedChannelOptions options, Func<TOut, TOut> optionalfirstStep = null) :
public ChannelBlock(BoundedChannelOptions options, Func<TOut, TOut> optionalfirstStep = null) :
this(Channel.CreateBounded<TOut>(options), new TransformBlock<TOut, TOut>(optionalfirstStep ?? (input => input)))
{
Guard.AgainstNull(options, nameof(options));
Expand All @@ -25,7 +25,7 @@ public ChannelBlock(UnboundedChannelOptions options, Func<TOut, TOut> optionalfi
Guard.AgainstNull(options, nameof(options));
}

public ChannelBlock(Channel<TOut> channel, Func<TOut, TOut> optionalfirstStep = null) :
public ChannelBlock(Channel<TOut> channel, Func<TOut, TOut> optionalfirstStep = null) :
this(channel, new TransformBlock<TOut, TOut>(optionalfirstStep ?? (input => input)))
{ }

Expand Down
12 changes: 6 additions & 6 deletions src/HouseofCat.Dataflows/ChannelReaderBlockEngine.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using HouseofCat.Utilities.Helpers;
using Microsoft.Extensions.Logging;
using System;
using System.Threading;
using System.Threading.Channels;
using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;
using HouseofCat.Utilities.Helpers;
using Microsoft.Extensions.Logging;

namespace HouseofCat.Dataflows;

Expand All @@ -17,14 +17,14 @@ public class ChannelReaderBlockEngine<TIn, TOut>
private readonly ChannelReaderBlock<TIn> _channelReaderBlock;
private readonly Func<TIn, Task<TOut>> _workBodyAsync;
private readonly Func<TOut, Task> _postWorkBodyAsync;

public ChannelReaderBlockEngine(
ChannelReader<TIn> channelReader,
Func<TIn, Task<TOut>> workBodyAsync,
int? maxDegreeOfParallelism,
bool? ensureOrdered,
Func<TOut, Task> postWorkBodyAsync = null,
TaskScheduler taskScheduler = null) :
TaskScheduler taskScheduler = null) :
this(workBodyAsync, maxDegreeOfParallelism, ensureOrdered, taskScheduler, postWorkBodyAsync)
{
_channelReaderBlock = new ChannelReaderBlock<TIn>(channelReader, _executeOptions);
Expand All @@ -48,7 +48,7 @@ protected ChannelReaderBlockEngine(
};

_postWorkBodyAsync = postWorkBodyAsync;

if (taskScheduler != null)
{
_executeOptions.TaskScheduler = taskScheduler;
Expand Down Expand Up @@ -84,5 +84,5 @@ private async Task ExecuteWorkBodyAsync(TIn data)
_logger.LogError(ex, _error);
}
}
}
}

2 changes: 1 addition & 1 deletion src/HouseofCat.Hashing/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class Argon
// Recommend 2 GB for the highest security scenarios.
// Recommend a minimum of 64 MB in high security scenarios.
// Recommend a minimum of 2 MB in low security scenarios.
public static int MemorySize { get; set; } = 1024*64;
public static int MemorySize { get; set; } = 1024 * 64;

// Recommend a minimum of 3 for most security scenarios.
public static int Iterations { get; set; } = 3;
Expand Down
1 change: 0 additions & 1 deletion src/HouseofCat.RabbitMQ/Dataflows/ConsumerDataflow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using OpenTelemetry.Trace;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;
Expand Down
2 changes: 0 additions & 2 deletions src/HouseofCat.RabbitMQ/Pools/ConnectionHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
using RabbitMQ.Client;
using RabbitMQ.Client.Events;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace HouseofCat.RabbitMQ.Pools;

Expand Down
3 changes: 0 additions & 3 deletions src/HouseofCat.RabbitMQ/Services/RabbitService.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using HouseofCat.Compression;
using HouseofCat.Dataflows.Pipelines;
using HouseofCat.Encryption;
using HouseofCat.RabbitMQ.Dataflows;
using HouseofCat.RabbitMQ.Pipelines;
using HouseofCat.RabbitMQ.Pools;
using HouseofCat.Serialization;
using HouseofCat.Utilities;
Expand Down

0 comments on commit 6dece61

Please sign in to comment.