From 393032b048e07c0816ce87bdbb2f162ab64a5c00 Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Thu, 23 May 2024 11:55:06 -0700 Subject: [PATCH] Remove two unnecessary `.Cast<>()` usages Noticed by @paulomorgado in #1233 --- projects/RabbitMQ.Client/client/impl/AsyncEventingWrapper.cs | 3 +-- projects/RabbitMQ.Client/client/impl/EventingWrapper.cs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/projects/RabbitMQ.Client/client/impl/AsyncEventingWrapper.cs b/projects/RabbitMQ.Client/client/impl/AsyncEventingWrapper.cs index 29f007b7c6..49e6c18aad 100644 --- a/projects/RabbitMQ.Client/client/impl/AsyncEventingWrapper.cs +++ b/projects/RabbitMQ.Client/client/impl/AsyncEventingWrapper.cs @@ -1,5 +1,4 @@ using System; -using System.Linq; using System.Threading.Tasks; using RabbitMQ.Client.Events; @@ -55,7 +54,7 @@ public Task InvokeAsync(object sender, T parameter) private readonly async Task InternalInvoke(Delegate[] handlers, object sender, T parameter) { - foreach (AsyncEventHandler action in handlers.Cast>()) + foreach (AsyncEventHandler action in handlers) { try { diff --git a/projects/RabbitMQ.Client/client/impl/EventingWrapper.cs b/projects/RabbitMQ.Client/client/impl/EventingWrapper.cs index 4017fb4052..f9a1a334cb 100644 --- a/projects/RabbitMQ.Client/client/impl/EventingWrapper.cs +++ b/projects/RabbitMQ.Client/client/impl/EventingWrapper.cs @@ -1,5 +1,4 @@ using System; -using System.Linq; namespace RabbitMQ.Client.Impl { @@ -53,7 +52,7 @@ public void Invoke(object sender, T parameter) _handlers = handlers; } - foreach (EventHandler action in handlers.Cast>()) + foreach (EventHandler action in handlers) { try {