This is an automated email from the ASF dual-hosted git repository. blankensteiner pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/pulsar-dotpulsar.git
commit f1097ece42a0ddfcc5c4e0fa37839848d8aeab79 Author: SeĢrgio Silveira <[email protected]> AuthorDate: Tue Mar 31 16:19:32 2020 +0200 code review change requests --- src/DotPulsar/Internal/AsyncQueue.cs | 2 -- src/DotPulsar/Internal/Connection.cs | 16 ++++++++-------- src/DotPulsar/Internal/Connector.cs | 4 ++-- src/DotPulsar/Internal/Constants.cs | 2 +- src/DotPulsar/Internal/Consumer.cs | 3 +-- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/DotPulsar/Internal/AsyncQueue.cs b/src/DotPulsar/Internal/AsyncQueue.cs index 800cf9f..fc9c8f9 100644 --- a/src/DotPulsar/Internal/AsyncQueue.cs +++ b/src/DotPulsar/Internal/AsyncQueue.cs @@ -48,9 +48,7 @@ namespace DotPulsar.Internal tcs.Value.SetResult(item); } else - { _queue.Enqueue(item); - } } } diff --git a/src/DotPulsar/Internal/Connection.cs b/src/DotPulsar/Internal/Connection.cs index 5ec24ff..ae4e470 100644 --- a/src/DotPulsar/Internal/Connection.cs +++ b/src/DotPulsar/Internal/Connection.cs @@ -85,17 +85,17 @@ namespace DotPulsar.Internal return await responseTask.ConfigureAwait(false); } - public async Task Send(CommandPing command, CancellationToken cancellationToken) - => await Send(command.AsBaseCommand(), cancellationToken).ConfigureAwait(false); + public Task Send(CommandPing command, CancellationToken cancellationToken) + => Send(command.AsBaseCommand(), cancellationToken); - public async Task Send(CommandPong command, CancellationToken cancellationToken) - => await Send(command.AsBaseCommand(), cancellationToken).ConfigureAwait(false); + public Task Send(CommandPong command, CancellationToken cancellationToken) + => Send(command.AsBaseCommand(), cancellationToken); - public async Task Send(CommandAck command, CancellationToken cancellationToken) - => await Send(command.AsBaseCommand(), cancellationToken).ConfigureAwait(false); + public Task Send(CommandAck command, CancellationToken cancellationToken) + => Send(command.AsBaseCommand(), cancellationToken); - public async Task Send(CommandFlow command, CancellationToken cancellationToken) - => await Send(command.AsBaseCommand(), cancellationToken).ConfigureAwait(false); + public Task Send(CommandFlow command, CancellationToken cancellationToken) + => Send(command.AsBaseCommand(), cancellationToken); public async Task<BaseCommand> Send(CommandUnsubscribe command, CancellationToken cancellationToken) { diff --git a/src/DotPulsar/Internal/Connector.cs b/src/DotPulsar/Internal/Connector.cs index b5d70f7..515347e 100644 --- a/src/DotPulsar/Internal/Connector.cs +++ b/src/DotPulsar/Internal/Connector.cs @@ -126,9 +126,9 @@ namespace DotPulsar.Internal chain.ChainPolicy.ExtraStore.Add(_trustedCertificateAuthority); _ = chain.Build((X509Certificate2) certificate); - foreach (var element in chain.ChainElements) + for (var i = 0; i < chain.ChainElements.Count; i++) { - if (element.Certificate.Thumbprint == _trustedCertificateAuthority.Thumbprint) + if (chain.ChainElements[i].Certificate.Thumbprint == _trustedCertificateAuthority.Thumbprint) return true; } diff --git a/src/DotPulsar/Internal/Constants.cs b/src/DotPulsar/Internal/Constants.cs index ea0c44c..9c21fd2 100644 --- a/src/DotPulsar/Internal/Constants.cs +++ b/src/DotPulsar/Internal/Constants.cs @@ -27,7 +27,7 @@ namespace DotPulsar.Internal PulsarSslScheme = "pulsar+ssl"; DefaultPulsarPort = 6650; DefaultPulsarSSLPort = 6651; - MagicNumber = new byte[] { 0x0e, 0x01 }; + MagicNumber = new byte[] { 0x0e, 0x01 }; MetadataSizeOffset = 6; MetadataOffset = 10; } diff --git a/src/DotPulsar/Internal/Consumer.cs b/src/DotPulsar/Internal/Consumer.cs index 4f895f3..d7b4711 100644 --- a/src/DotPulsar/Internal/Consumer.cs +++ b/src/DotPulsar/Internal/Consumer.cs @@ -117,8 +117,7 @@ namespace DotPulsar.Internal { ThrowIfDisposed(); - var response = await _executor.Execute(() => _channel.Send(new CommandGetLastMessageId(), cancellationToken), cancellationToken) - .ConfigureAwait(false); + var response = await _executor.Execute(() => _channel.Send(new CommandGetLastMessageId(), cancellationToken), cancellationToken).ConfigureAwait(false); return new MessageId(response.LastMessageId); }
