// Token: 0x060062BC RID: 25276 RVA: 0x00150044 File Offset: 0x0014E244
        public void Split(out IMapView <TKey, TValue> firstPartition, out IMapView <TKey, TValue> secondPartition)
        {
            if (this.Count < 2)
            {
                firstPartition  = null;
                secondPartition = null;
                return;
            }
            int num = (int)(((long)this.firstItemIndex + (long)this.lastItemIndex) / 2L);

            firstPartition  = new ConstantSplittableMap <TKey, TValue>(this.items, this.firstItemIndex, num);
            secondPartition = new ConstantSplittableMap <TKey, TValue>(this.items, num + 1, this.lastItemIndex);
        }
Exemplo n.º 2
0
        public void Split(out global::System.Collections.Generic.IReadOnlyDictionary <TKey, TValue> firstPartition, out global::System.Collections.Generic.IReadOnlyDictionary <TKey, TValue> secondPartition)
        {
            if (Count < 2)
            {
                firstPartition  = null;
                secondPartition = null;
                return;
            }

            int pivot = (int)(((long)firstItemIndex + (long)lastItemIndex) / (long)2);

            firstPartition  = new ConstantSplittableMap <TKey, TValue>(items, firstItemIndex, pivot);
            secondPartition = new ConstantSplittableMap <TKey, TValue>(items, pivot + 1, lastItemIndex);
        }
Exemplo n.º 3
0
        public void Split(out IMapView <TKey, TValue> firstPartition, out IMapView <TKey, TValue> secondPartition)
        {
            if (Count < 2)
            {
                firstPartition  = null;
                secondPartition = null;
                return;
            }

            int pivot = (Int32)(((Int64)firstItemIndex + (Int64)lastItemIndex) / (Int64)2);

            firstPartition  = new ConstantSplittableMap <TKey, TValue>(items, firstItemIndex, pivot);
            secondPartition = new ConstantSplittableMap <TKey, TValue>(items, pivot + 1, lastItemIndex);
        }
Exemplo n.º 4
0
        internal void Split <K, V>(out IMapView <K, V>?first, out IMapView <K, V>?second)
        {
            IReadOnlyDictionary <K, V> _this = Unsafe.As <IReadOnlyDictionary <K, V> >(this);

            if (_this.Count < 2)
            {
                first  = null;
                second = null;
                return;
            }

            if (!(_this is ConstantSplittableMap <K, V> splittableMap))
            {
                splittableMap = new ConstantSplittableMap <K, V>(_this);
            }

            splittableMap.Split(out first, out second);
        }
        internal void Split <K, V>(out IMapView <K, V> first, out IMapView <K, V> second)
        {
            IReadOnlyDictionary <K, V> readOnlyDictionary = JitHelpers.UnsafeCast <IReadOnlyDictionary <K, V> >(this);

            if (readOnlyDictionary.Count < 2)
            {
                first  = null;
                second = null;
                return;
            }
            ConstantSplittableMap <K, V> constantSplittableMap = readOnlyDictionary as ConstantSplittableMap <K, V>;

            if (constantSplittableMap == null)
            {
                constantSplittableMap = new ConstantSplittableMap <K, V>(readOnlyDictionary);
            }
            constantSplittableMap.Split(out first, out second);
        }
Exemplo n.º 6
0
        // void Split(out IReadOnlyDictionary<K, V> first, out IReadOnlyDictionary<K, V> second)
        public static void Split <K, V>(global::System.Collections.Generic.IReadOnlyDictionary <K, V> _this,
                                        out global::System.Collections.Generic.IReadOnlyDictionary <K, V> first,
                                        out global::System.Collections.Generic.IReadOnlyDictionary <K, V> second)
        {
            if (_this.Count < 2)
            {
                first  = null;
                second = null;
                return;
            }

            ConstantSplittableMap <K, V> splittableMap = _this as ConstantSplittableMap <K, V>;

            if (splittableMap == null)
            {
                splittableMap = new ConstantSplittableMap <K, V>(_this);
            }

            splittableMap.Split(out first, out second);
        }
Exemplo n.º 7
0
        // void Split(out IMapView<K, V> first, out IMapView<K, V> second)
        internal void Split <K, V>(out IMapView <K, V> first, out IMapView <K, V> second)
        {
            IReadOnlyDictionary <K, V> _this = JitHelpers.UnsafeCast <IReadOnlyDictionary <K, V> >(this);

            if (_this.Count < 2)
            {
                first  = null;
                second = null;
                return;
            }

            ConstantSplittableMap <K, V> splittableMap = _this as ConstantSplittableMap <K, V>;

            if (splittableMap == null)
            {
                splittableMap = new ConstantSplittableMap <K, V>(_this);
            }

            splittableMap.Split(out first, out second);
        }