Skip to content

Commit f541d82

Browse files
committed
Remove two unnecessary .Cast<>() usages
Noticed by @paulomorgado in #1233
1 parent 2a48e6c commit f541d82

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

projects/RabbitMQ.Client/client/impl/AsyncEventingWrapper.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Linq;
32
using System.Threading.Tasks;
43
using RabbitMQ.Client.Events;
54

@@ -55,7 +54,7 @@ public Task InvokeAsync(object sender, T parameter)
5554

5655
private readonly async Task InternalInvoke(Delegate[] handlers, object sender, T parameter)
5756
{
58-
foreach (AsyncEventHandler<T> action in handlers.Cast<AsyncEventHandler<T>>())
57+
foreach (AsyncEventHandler<T> action in handlers)
5958
{
6059
try
6160
{

projects/RabbitMQ.Client/client/impl/EventingWrapper.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Linq;
32

43
namespace RabbitMQ.Client.Impl
54
{
@@ -53,7 +52,7 @@ public void Invoke(object sender, T parameter)
5352
_handlers = handlers;
5453
}
5554

56-
foreach (EventHandler<T> action in handlers.Cast<EventHandler<T>>())
55+
foreach (EventHandler<T> action in handlers)
5756
{
5857
try
5958
{

0 commit comments

Comments
 (0)