Simplify TimeZoneInfo.Equals(object) (dotnet/coreclr#8514)
authorJustin Van Patten <jvp@justinvp.com>
Thu, 8 Dec 2016 21:21:28 +0000 (13:21 -0800)
committerJan Kotas <jkotas@microsoft.com>
Thu, 8 Dec 2016 21:21:28 +0000 (13:21 -0800)
Equals(TimeZoneInfo) already handles null.

Commit migrated from https://github.com/dotnet/coreclr/commit/6d657999abeef7e5410af28c1273feb133ca6c7d

src/coreclr/src/mscorlib/src/System/TimeZoneInfo.cs

index 85f28ca..5000206 100644 (file)
@@ -946,11 +946,7 @@ namespace System {
         }
 
         public override bool Equals(object obj) {
-            TimeZoneInfo tzi = obj as TimeZoneInfo;            
-            if (null == tzi) {
-                return false;
-            }            
-            return Equals(tzi);
+            return Equals(obj as TimeZoneInfo);
         }
 
         //