[corlib] minor code cleanup
authorJeffrey Stedfast <jeff@xamarin.com>
Sun, 13 Jul 2014 12:29:09 +0000 (08:29 -0400)
committerJeffrey Stedfast <jeff@xamarin.com>
Sun, 13 Jul 2014 12:29:09 +0000 (08:29 -0400)
mcs/class/corlib/System.Threading/CancellationTokenRegistration.cs

index 1c352ff7d3e79b0b42c02b1d07924bec50807f99..54fe237c79383a4c4eb8d9ca65e37d7a5d014b50 100644 (file)
 
 #if NET_4_0
 using System;
-using System.Threading;
 
 namespace System.Threading
 {
        public struct CancellationTokenRegistration: IDisposable, IEquatable<CancellationTokenRegistration>
        {
-               int id;
-               CancellationTokenSource source;
+               readonly int id;
+               readonly CancellationTokenSource source;
                
                internal CancellationTokenRegistration (int id, CancellationTokenSource source)
                {
@@ -52,7 +51,7 @@ namespace System.Threading
                #region IEquatable<CancellationTokenRegistration> implementation
                public bool Equals (CancellationTokenRegistration other)
                {
-                       return this.id == other.id && this.source == other.source;
+                       return id == other.id && source == other.source;
                }
                
                public static bool operator== (CancellationTokenRegistration left, CancellationTokenRegistration right)
@@ -73,7 +72,7 @@ namespace System.Threading
 
                public override bool Equals (object obj)
                {
-                       return (obj is CancellationTokenRegistration) ? Equals ((CancellationTokenRegistration)obj) : false;
+                       return (obj is CancellationTokenRegistration) && Equals ((CancellationTokenRegistration)obj);
                }
        }
 }