summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Security/Util/TokenBasedSet.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Security/Util/TokenBasedSet.cs')
-rw-r--r--src/mscorlib/src/System/Security/Util/TokenBasedSet.cs32
1 files changed, 4 insertions, 28 deletions
diff --git a/src/mscorlib/src/System/Security/Util/TokenBasedSet.cs b/src/mscorlib/src/System/Security/Util/TokenBasedSet.cs
index 590a909662..8589fa7c42 100644
--- a/src/mscorlib/src/System/Security/Util/TokenBasedSet.cs
+++ b/src/mscorlib/src/System/Security/Util/TokenBasedSet.cs
@@ -9,6 +9,7 @@ namespace System.Security.Util
using System.Security.Permissions;
using System.Runtime.Serialization;
using System.Threading;
+ using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Diagnostics.CodeAnalysis;
@@ -368,31 +369,17 @@ namespace System.Security.Util
{
Object thisObj = this.GetItem( i );
IPermission thisPerm = thisObj as IPermission;
-#if FEATURE_CAS_POLICY
- ISecurityElementFactory thisElem = thisObj as ISecurityElementFactory;
-#endif // FEATURE_CAS_POLICY
Object otherObj = (other != null)?other.GetItem( i ):null;
IPermission otherPerm = otherObj as IPermission;
-#if FEATURE_CAS_POLICY
- ISecurityElementFactory otherElem = otherObj as ISecurityElementFactory;
-#endif // FEATURE_CAS_POLICY
if (thisObj == null && otherObj == null)
continue;
-
-
+
if (thisObj == null)
{
-#if FEATURE_CAS_POLICY
- if (otherElem != null)
- {
- otherPerm = PermissionSet.CreatePerm(otherElem, false);
- }
-#endif // FEATURE_CAS_POLICY
-
PermissionToken token = PermissionToken.GetToken(otherPerm);
-
+
if (token == null)
{
throw new SerializationException(Environment.GetResourceString("Serialization_InsufficientState"));
@@ -402,13 +389,6 @@ namespace System.Security.Util
}
else if (otherObj == null)
{
-#if FEATURE_CAS_POLICY
- if (thisElem != null)
- {
- thisPerm = PermissionSet.CreatePerm(thisElem, false);
- }
-#endif // FEATURE_CAS_POLICY
-
PermissionToken token = PermissionToken.GetToken(thisPerm);
if (token == null)
{
@@ -418,7 +398,7 @@ namespace System.Security.Util
}
else
{
- Contract.Assert( (thisObj == null || otherObj == null), "Permission cannot be in both TokenBasedSets" );
+ Debug.Assert( (thisObj == null || otherObj == null), "Permission cannot be in both TokenBasedSets" );
}
}
return unionSet;
@@ -434,10 +414,6 @@ namespace System.Security.Util
if (obj != null)
{
IPermission perm = obj as IPermission;
-#if FEATURE_CAS_POLICY
- if (perm == null)
- perm = PermissionSet.CreatePerm(obj, ignoreTypeLoadFailures);
-#endif // FEATURE_CAS_POLICY
PermissionToken token = PermissionToken.GetToken(perm);
if (perm == null || token == null)