<commit_before>using System;
using System.Runtime.Remoting.Messaging;
using EasyRabbitMQ.Infrastructure;
using EasyRabbitMQ.Logging;
using EasyRabbitMQ.Retry;
using EasyRabbitMQ.Serialization;

namespace EasyRabbitMQ.Subscribe
{
    internal class SubscriptionFactory : ISubscriptionFactory
    {
        private readonly IChannelFactory _channelFactory;
        private readonly ISerializer _serializer;
        private readonly ILoggerFactory _loggerFactory;
        private readonly IMessageRetryHandler _messageRetryHandler;

        internal SubscriptionFactory(IChannelFactory channelFactory, ISerializer serializer, ILoggerFactory loggerFactory,
            IMessageRetryHandler messageRetryHandler)
        {
            _channelFactory = channelFactory;
            _serializer = serializer;
            _loggerFactory = loggerFactory;
            _messageRetryHandler = messageRetryHandler;
        }

        public ISubscription<T> SubscribeQueue<T>(string queue)
        {
            if (string.IsNullOrEmpty(queue)) throw new ArgumentNullException(nameof(queue));

            var channel = _channelFactory.CreateChannel();
            var serializer = _serializer;
            var loggerFactory = _loggerFactory;
            return new QueueAsyncSubscription<T>(channel, serializer, loggerFactory, _messageRetryHandler, queue);
        }

        public ISubscription<T> SubscribeExchange<T>(string exchange, string queue, string routingKey, ExchangeType exchangeType)
        {
            if (string.IsNullOrEmpty(exchange)) throw new ArgumentNullException(nameof(exchange));
            if (queue == null) throw new ArgumentNullException(nameof(queue));
            if (routingKey == null) throw new ArgumentNullException(nameof(routingKey));

            var channel = _channelFactory.CreateChannel();
            var serializer = _serializer;
            var loggerFactory = _loggerFactory;
            return new ExchangeAsyncSubscription<T>(channel, serializer, loggerFactory, _messageRetryHandler,
                exchange, queue, routingKey, exchangeType);
        }
    }
}<commit_msg>Removed redundant code<commit_after>using System;
using EasyRabbitMQ.Infrastructure;
using EasyRabbitMQ.Logging;
using EasyRabbitMQ.Retry;
using EasyRabbitMQ.Serialization;

namespace EasyRabbitMQ.Subscribe
{
    internal class SubscriptionFactory : ISubscriptionFactory
    {
        private readonly IChannelFactory _channelFactory;
        private readonly ISerializer _serializer;
        private readonly ILoggerFactory _loggerFactory;
        private readonly IMessageRetryHandler _messageRetryHandler;

        internal SubscriptionFactory(IChannelFactory channelFactory, ISerializer serializer, ILoggerFactory loggerFactory,
            IMessageRetryHandler messageRetryHandler)
        {
            _channelFactory = channelFactory;
            _serializer = serializer;
            _loggerFactory = loggerFactory;
            _messageRetryHandler = messageRetryHandler;
        }

        public ISubscription<T> SubscribeQueue<T>(string queue)
        {
            if (string.IsNullOrEmpty(queue)) throw new ArgumentNullException(nameof(queue));

            var channel = _channelFactory.CreateChannel();
            return new QueueAsyncSubscription<T>(channel, _serializer, _loggerFactory, _messageRetryHandler, queue);
        }

        public ISubscription<T> SubscribeExchange<T>(string exchange, string queue, string routingKey, ExchangeType exchangeType)
        {
            if (string.IsNullOrEmpty(exchange)) throw new ArgumentNullException(nameof(exchange));
            if (queue == null) throw new ArgumentNullException(nameof(queue));
            if (routingKey == null) throw new ArgumentNullException(nameof(routingKey));

            var channel = _channelFactory.CreateChannel();
            return new ExchangeAsyncSubscription<T>(channel, _serializer, _loggerFactory, _messageRetryHandler,
                exchange, queue, routingKey, exchangeType);
        }
    }
}
{'fraction_non_alphanumeric': 0.06527154957648232, 'fraction_numerical': 0.0, 'mean_word_length': 3.317204301075269, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3514764', 'n_tokens_mistral': 975, 'n_tokens_neox': 966, 'n_words': 232}