diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2017-02-10 20:35:12 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2017-02-10 20:35:12 +0900 |
commit | 4b11dc566a5bbfa1378d6266525c281b028abcc8 (patch) | |
tree | b48831a898906734f8884d08b6e18f1144ee2b82 /src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs | |
parent | db20f3f1bb8595633a7e16c8900fd401a453a6b5 (diff) | |
download | coreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.tar.gz coreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.tar.bz2 coreclr-4b11dc566a5bbfa1378d6266525c281b028abcc8.zip |
Imported Upstream version 1.0.0.9910upstream/1.0.0.9910
Diffstat (limited to 'src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs')
-rw-r--r-- | src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs | 62 |
1 files changed, 1 insertions, 61 deletions
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs index a5abb4f23e..3a896ecbe3 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs @@ -53,25 +53,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime this.items = CreateKeyValueArray(data.Count, data.GetEnumerator()); } - internal ConstantSplittableMap(IMapView<TKey, TValue> data) - { - if (data == null) - throw new ArgumentNullException(nameof(data)); - - if (((UInt32)Int32.MaxValue) < data.Size) - { - Exception e = new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingDictionaryTooLarge")); - e.SetErrorCode(__HResults.E_BOUNDS); - throw e; - } - - int size = (int)data.Size; - - this.firstItemIndex = 0; - this.lastItemIndex = size - 1; - this.items = CreateKeyValueArray(size, data.GetEnumerator()); - } - private ConstantSplittableMap(KeyValuePair<TKey, TValue>[] items, Int32 firstItemIndex, Int32 lastItemIndex) { @@ -94,22 +75,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime return kvArray; } - private KeyValuePair<TKey, TValue>[] CreateKeyValueArray(Int32 count, IEnumerator<IKeyValuePair<TKey, TValue>> data) - { - KeyValuePair<TKey, TValue>[] kvArray = new KeyValuePair<TKey, TValue>[count]; - - Int32 i = 0; - while (data.MoveNext()) - { - IKeyValuePair<TKey, TValue> current = data.Current; - kvArray[i++] = new KeyValuePair<TKey, TValue>(current.Key, current.Value); - } - - Array.Sort(kvArray, keyValuePairComparator); - - return kvArray; - } - public int Count { get { @@ -179,14 +144,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime secondPartition = new ConstantSplittableMap<TKey, TValue>(items, pivot + 1, lastItemIndex); } - #region IReadOnlyDictionary members - - public bool ContainsKey(TKey key) - { - KeyValuePair<TKey, TValue> searchKey = new KeyValuePair<TKey, TValue>(key, default(TValue)); - int index = Array.BinarySearch(items, firstItemIndex, Count, searchKey, keyValuePairComparator); - return index >= 0; - } +#region IReadOnlyDictionary members public bool TryGetValue(TKey key, out TValue value) { @@ -203,24 +161,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime return true; } - public TValue this[TKey key] { - get { - return Lookup(key); - } - } - - public IEnumerable<TKey> Keys { - get { - throw new NotImplementedException("NYI"); - } - } - - public IEnumerable<TValue> Values { - get { - throw new NotImplementedException("NYI"); - } - } - #endregion IReadOnlyDictionary members #region IKeyValuePair Enumerator |