Update Reference Sources to .NET Framework 4.6.1
[mono.git] / mcs / class / referencesource / System.Xml / System / Xml / Schema / ConstraintStruct.cs
index 468d82b7431389dfa18cf8e9d07cfb62d3fdea99..4e6cbfc1cd9b4e5de7af734db0f69f0ffde98f18 100644 (file)
@@ -2,7 +2,7 @@
 // <copyright file="ConstraintStruct.cs" company="Microsoft">
 //     Copyright (c) Microsoft Corporation.  All rights reserved.
 // </copyright>
-// <owner current="true" primary="true">Microsoft</owner>                                                                
+// <owner current="true" primary="true">[....]</owner>                                                                
 //------------------------------------------------------------------------------
 
 namespace System.Xml.Schema {
@@ -386,10 +386,9 @@ namespace System.Xml.Schema {
             }
             hashcode = 0;  // indicate it's changed. even the calculated hashcode below is 0
             for (int i = 0; i < this.ks.Length; i ++) {
-                               if (this.ks[i] != null) {
-                                       // extract its primitive value to calculate hashcode
-                                       // decimal is handled differently to enable among different CLR types
-                                       this.ks[i].SetDecimal();
+                // extract its primitive value to calculate hashcode
+                // decimal is handled differently to enable among different CLR types
+                this.ks[i].SetDecimal();
                                        if (this.ks[i].IsDecimal) {
                                                for (int j = 0 ; j < this.ks[i].Dim ; j ++) {
                                                        hashcode += this.ks[i].Dvalue[j].GetHashCode();
@@ -415,55 +414,31 @@ namespace System.Xml.Schema {
                                                        hashcode += this.ks[i].Value.GetHashCode();
                                                }
                                        }
-                               }
             }
             return hashcode;
         }
 
         // considering about derived type
         public override bool Equals(object other) {
-            if (LocalAppContextSwitches.IgnoreEmptyKeySequences) {
-                // each key sequence member can have different type
-                KeySequence keySequence = (KeySequence)other;
-                for (int i = 0; i < this.ks.Length; i++) {
-                    if (!this.ks[i].Equals(keySequence.ks[i])) {
-                        return false;
-                    }
-                }
-                return true;
-            }
-            else {
-                // each key sequence member can have different type
-                KeySequence keySequence = (KeySequence)other;
-                for (int i = 0; i < this.ks.Length; i++) {
-                    if (!(this.ks[i] == null && keySequence.ks[i] == null) && (this.ks[i] == null || keySequence.ks[i] == null || !this.ks[i].Equals(keySequence.ks[i]))) {
-                        return false;
-                    }
+            // each key sequence member can have different type
+            KeySequence keySequence = (KeySequence)other;
+            for (int i = 0; i < this.ks.Length; i++) {
+                if (!this.ks[i].Equals(keySequence.ks[i])) {
+                    return false;
                 }
-                return true;
             }
-        }
+            return true;
+               }
 
         public override string ToString() {
-            if (LocalAppContextSwitches.IgnoreEmptyKeySequences) {
-                StringBuilder sb = new StringBuilder();
-                sb.Append(this.ks[0].ToString());
-                for (int i = 1; i < this.ks.Length; i++) {
-                    sb.Append(" ");
-                    sb.Append(this.ks[i].ToString());
-                }
-                return sb.ToString();
+            StringBuilder sb = new StringBuilder();
+            sb.Append(this.ks[0].ToString());
+            for (int i = 1; i < this.ks.Length; i++) {
+                sb.Append(" ");
+                sb.Append(this.ks[i].ToString());
             }
-            else {
-                StringBuilder sb = new StringBuilder();
-                sb.Append(this.ks[0].ToString());
-                for (int i = 1; i < this.ks.Length; i++) {
-                    sb.Append(" ");
-                    sb.Append(this.ks[i] == null ? "{}" : this.ks[i].ToString());
-                }
-                return sb.ToString();
-            }
-        }
+            return sb.ToString();
+               }
     }
 
 }