fastCSharp/template/list.cs

(开头部分) 22KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
/*Type:ulong;long;uint;int;ushort;short;byte;sbyte;double;float;DateTime*/

namespace fastCSharp
{
    /// <summary>
    /// 单向动态数组扩展
    /// </summary>
    public static partial class list
    {
        /// <summary>
        /// 添加数据集合
        /// </summary>
        /// <param name="list">单向动态数组</param>
        /// <param name="values">数据集合</param>
        /// <returns>单向动态数组</returns>
        public unsafe static list</*Type[0]*/ulong/*Type[0]*/> add
            (this list</*Type[0]*/ulong/*Type[0]*/> list, System.Collections.Generic.ICollection</*Type[0]*/ulong/*Type[0]*/> values)
        {
            if (list != null)
            {
                int count = values.count();
                if (count != 0)
                {
                    int index = list.Count;
                    list.AddLength(count);
                    fixed (/*Type[0]*/ulong/*Type[0]*/* valueFixed = list.Unsafer.Array)
                    {
                        /*Type[0]*/
                        ulong/*Type[0]*/* write = valueFixed + index;
                        foreach (/*Type[0]*/ulong/*Type[0]*/ nextValue in values) *write++ = nextValue;
                    }
                }
                return list;
            }
            return values.getList();
        }
        /// <summary>
        /// 获取匹配数据位置
        /// </summary>
        /// <param name="list">单向动态数组</param>
        /// <param name="value">匹配数据</param>
        /// <returns>匹配位置,失败为-1</returns>
        public unsafe static int indexOf(this list</*Type[0]*/ulong/*Type[0]*/> list, /*Type[0]*/ulong/*Type[0]*/ value)
        {
            return list.count() != 0 ? list.Unsafer.Array.indexOf(0, list.Count, value) : -1;
        }
        /// <summary>
        /// 获取匹配数据位置
        /// </summary>
        /// <param name="list">单向动态数组</param>
        /// <param name="isValue">数据匹配器</param>
        /// <returns>匹配位置,失败为-1</returns>
        public unsafe static int indexOf(this list</*Type[0]*/ulong/*Type[0]*/> list, func</*Type[0]*/ulong/*Type[0]*/, bool> isValue)
        {
            return list.count() != 0 ? list.Unsafer.Array.indexOf(0, list.Count, isValue) : -1;
        }
        /// <summary>
        /// 移除数据
        /// </summary>
后面还有 434 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。