< Summary - Jellyfin

Information
Class: Jellyfin.Extensions.CopyToExtensions
Assembly: Jellyfin.Extensions
File(s): /srv/git/jellyfin/src/Jellyfin.Extensions/CopyToExtensions.cs
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 26
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
CopyTo(...)100%22100%

File(s)

/srv/git/jellyfin/src/Jellyfin.Extensions/CopyToExtensions.cs

#LineLine coverage
 1using System.Collections.Generic;
 2
 3namespace Jellyfin.Extensions
 4{
 5    /// <summary>
 6    /// Provides <c>CopyTo</c> extensions methods for <see cref="IReadOnlyList{T}" />.
 7    /// </summary>
 8    public static class CopyToExtensions
 9    {
 10        /// <summary>
 11        /// Copies all the elements of the current collection to the specified list
 12        /// starting at the specified destination array index. The index is specified as a 32-bit integer.
 13        /// </summary>
 14        /// <param name="source">The current collection that is the source of the elements.</param>
 15        /// <param name="destination">The list that is the destination of the elements copied from the current collectio
 16        /// <param name="index">A 32-bit integer that represents the index in <c>destination</c> at which copying begins
 17        /// <typeparam name="T">The type of the array.</typeparam>
 18        public static void CopyTo<T>(this IReadOnlyList<T> source, IList<T> destination, int index = 0)
 19        {
 4420            for (int i = 0; i < source.Count; i++)
 21            {
 2022                destination[index + i] = source[i];
 23            }
 224        }
 25    }
 26}