diff options
Diffstat (limited to 'src/mscorlib/src/System/ValueType.cs')
-rw-r--r-- | src/mscorlib/src/System/ValueType.cs | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/src/mscorlib/src/System/ValueType.cs b/src/mscorlib/src/System/ValueType.cs index 06a64e397c..0cd08bd26f 100644 --- a/src/mscorlib/src/System/ValueType.cs +++ b/src/mscorlib/src/System/ValueType.cs @@ -10,24 +10,29 @@ ** ** ===========================================================*/ -namespace System { - using System; - using System.Reflection; - using System.Runtime.CompilerServices; - using System.Runtime.Versioning; - [Serializable] - public abstract class ValueType { +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.Versioning; - public override bool Equals (Object obj) { - BCLDebug.Perf(false, "ValueType::Equals is not fast. "+this.GetType().FullName+" should override Equals(Object)"); - if (null==obj) { +namespace System +{ + [Serializable] + public abstract class ValueType + { + public override bool Equals(Object obj) + { + BCLDebug.Perf(false, "ValueType::Equals is not fast. " + this.GetType().FullName + " should override Equals(Object)"); + if (null == obj) + { return false; } RuntimeType thisType = (RuntimeType)this.GetType(); RuntimeType thatType = (RuntimeType)obj.GetType(); - if (thatType!=thisType) { + if (thatType != thisType) + { return false; } @@ -41,16 +46,19 @@ namespace System { FieldInfo[] thisFields = thisType.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); - for (int i=0; i<thisFields.Length; i++) { + for (int i = 0; i < thisFields.Length; i++) + { thisResult = ((RtFieldInfo)thisFields[i]).UnsafeGetValue(thisObj); thatResult = ((RtFieldInfo)thisFields[i]).UnsafeGetValue(obj); - - if (thisResult == null) { + + if (thisResult == null) + { if (thatResult != null) return false; } else - if (!thisResult.Equals(thatResult)) { + if (!thisResult.Equals(thatResult)) + { return false; } } |