rabbitmq / rabbitmq-dotnet-client

RabbitMQ .NET client for .NET Standard 2.0+ and .NET 4.6.2+
https://www.rabbitmq.com/dotnet.html
Other
2.07k stars 579 forks source link

Remove two unnecessary `.Cast<>()` usages #1577

Closed lukebakken closed 4 months ago

lukebakken commented 4 months ago

Noticed by @paulomorgado in #1233

paulomorgado commented 4 months ago

Anytime you see System.Linq in your code or System.Linq.Enumerable in your profiling you should question that and benchmark.

If it's using a delegate or you have more than one operator, it's most likely a bad idea to use.