示例#1
0
            internal CoreEnumerator(OptimizedList <TEntity> list)
            {
                this.list = list;

                version = list.version;
                index   = 0;

                Current = default(TEntity);
            }
示例#2
0
            public bool MoveNext()
            {
                OptimizedList <TEntity> localList = list;

                if (version == localList.version && (index < localList.Count))
                {
                    Current = localList.itemsSource[index];
                    index++;

                    return(true);
                }

                return(MoveNextRare());
            }
示例#3
0
        public TEntity[] FindAll(Func <TEntity, bool> match)
        {
            if (match == null)
            {
                throw new ArgumentNullException("match", "Match item predicate can not be null.");
            }

            var list = new OptimizedList <TEntity>();
            var item = default(TEntity);

            for (int i = 0; i < Count; i++)
            {
                item = itemsSource[i];

                if (match(item))
                {
                    list.Add(item);
                }
            }

            return(list.ToArray());
        }
示例#4
0
 internal SynchronizedList(OptimizedList <TEntity> list)
 {
     this.list = list;
     root      = list.SyncRoot;
 }