aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2021-09-06 11:08:40 -0600
committerCody Robibero <cody@robibe.ro>2021-09-06 11:08:40 -0600
commit23e6c918a22c85751cc0907cd0074ee3f3445664 (patch)
treec4f73d048b1ac9ed247dd2b0a8600f5ea2785864
parent04973a489f0ed4ad9d65a7bb6fec0e03d00c6142 (diff)
Remove Linq to index search
-rw-r--r--Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs10
1 files changed, 4 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
index 6686b625f..1f963e4a2 100644
--- a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
+++ b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
@@ -10,7 +10,6 @@ using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
-using System.Net.Http.Json;
using System.Net.Mime;
using System.Text;
using System.Text.Json;
@@ -803,11 +802,10 @@ namespace Emby.Server.Implementations.LiveTv.Listings
{
var channelNumber = GetChannelNumber(channel);
- var station = allStations.FirstOrDefault(item => string.Equals(item.StationId, channel.StationId, StringComparison.OrdinalIgnoreCase))
- ?? new StationDto
- {
- StationId = channel.StationId
- };
+ var stationIndex = allStations.FindIndex(item => string.Equals(item.StationId, channel.StationId, StringComparison.OrdinalIgnoreCase));
+ var station = stationIndex == -1
+ ? new StationDto { StationId = channel.StationId }
+ : allStations[stationIndex];
var channelInfo = new ChannelInfo
{