summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Collections/Generic/Dictionary.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Collections/Generic/Dictionary.cs')
-rw-r--r--src/mscorlib/src/System/Collections/Generic/Dictionary.cs44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/mscorlib/src/System/Collections/Generic/Dictionary.cs b/src/mscorlib/src/System/Collections/Generic/Dictionary.cs
index e360eef..cd33428 100644
--- a/src/mscorlib/src/System/Collections/Generic/Dictionary.cs
+++ b/src/mscorlib/src/System/Collections/Generic/Dictionary.cs
@@ -17,29 +17,6 @@
** thread safety. If a reader writer lock is available, then that may be used
** with a Dictionary to get the same thread safety guarantee.
**
-** Reader writer locks don't exist in silverlight, so we do the following as a
-** result of removing non-generic collections from silverlight:
-** 1. If the Hashtable was fully synchronized, then we replace it with a
-** Dictionary with full locks around reads/writes (same thread safety
-** guarantee).
-** 2. Otherwise, the Hashtable has the default MR/SW thread safety behavior,
-** so we do one of the following on a case-by-case basis:
-** a. If the race condition can be addressed by rearranging the code and using a temp
-** variable (for example, it's only populated immediately after created)
-** then we address the race condition this way and use Dictionary.
-** b. If there's concern about degrading performance with the increased
-** locking, we ifdef with FEATURE_NONGENERIC_COLLECTIONS so we can at
-** least use Hashtable in the desktop build, but Dictionary with full
-** locks in silverlight builds. Note that this is heavier locking than
-** MR/SW, but this is the only option without rewriting (or adding back)
-** the reader writer lock.
-** c. If there's no performance concern (e.g. debug-only code) we
-** consistently replace Hashtable with Dictionary plus full locks to
-** reduce complexity.
-** d. Most of serialization is dead code in silverlight. Instead of updating
-** those Hashtable occurences in serialization, we carved out references
-** to serialization such that this code doesn't need to build in
-** silverlight.
===========================================================*/
namespace System.Collections.Generic
@@ -706,22 +683,6 @@ namespace System.Collections.Generic
value = default(TValue);
return false;
}
-
- // Method similar to TryGetValue that returns the value instead of putting it in an out param.
- public TValue GetValueOrDefault(TKey key) => GetValueOrDefault(key, default(TValue));
-
- // Method similar to TryGetValue that returns the value instead of putting it in an out param. If the entry
- // doesn't exist, returns the defaultValue instead.
- public TValue GetValueOrDefault(TKey key, TValue defaultValue)
- {
- int i = FindEntry(key);
- if (i >= 0)
- {
- return entries[i].value;
- }
- return defaultValue;
- }
-
public bool TryAdd(TKey key, TValue value) => TryInsert(key, value, InsertionBehavior.None);
bool ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly
@@ -947,7 +908,6 @@ namespace System.Collections.Generic
}
}
- [Serializable]
public struct Enumerator : IEnumerator<KeyValuePair<TKey, TValue>>,
IDictionaryEnumerator
{
@@ -1076,7 +1036,6 @@ namespace System.Collections.Generic
[DebuggerTypeProxy(typeof(Mscorlib_DictionaryKeyCollectionDebugView<,>))]
[DebuggerDisplay("Count = {Count}")]
- [Serializable]
public sealed class KeyCollection : ICollection<TKey>, ICollection, IReadOnlyCollection<TKey>
{
private Dictionary<TKey, TValue> dictionary;
@@ -1227,7 +1186,6 @@ namespace System.Collections.Generic
get { return ((ICollection)dictionary).SyncRoot; }
}
- [Serializable]
public struct Enumerator : IEnumerator<TKey>, System.Collections.IEnumerator
{
private Dictionary<TKey, TValue> dictionary;
@@ -1306,7 +1264,6 @@ namespace System.Collections.Generic
[DebuggerTypeProxy(typeof(Mscorlib_DictionaryValueCollectionDebugView<,>))]
[DebuggerDisplay("Count = {Count}")]
- [Serializable]
public sealed class ValueCollection : ICollection<TValue>, ICollection, IReadOnlyCollection<TValue>
{
private Dictionary<TKey, TValue> dictionary;
@@ -1455,7 +1412,6 @@ namespace System.Collections.Generic
get { return ((ICollection)dictionary).SyncRoot; }
}
- [Serializable]
public struct Enumerator : IEnumerator<TValue>, System.Collections.IEnumerator
{
private Dictionary<TKey, TValue> dictionary;