mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 14:03:03 +03:00
More efficient array creation (#11468)
This commit is contained in:
@@ -30,15 +30,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
if (item.RemoteTrailers.Count == 0)
|
||||
{
|
||||
item.RemoteTrailers = new[] { mediaUrl };
|
||||
item.RemoteTrailers = [mediaUrl];
|
||||
}
|
||||
else
|
||||
{
|
||||
var oldIds = item.RemoteTrailers;
|
||||
var newIds = new MediaUrl[oldIds.Count + 1];
|
||||
oldIds.CopyTo(newIds);
|
||||
newIds[oldIds.Count] = mediaUrl;
|
||||
item.RemoteTrailers = newIds;
|
||||
item.RemoteTrailers = [..item.RemoteTrailers, mediaUrl];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user