I知 using the latest BigInteger.cs in BouncyCastle and get a compiler warning 
for the following method.  Is this an issue?

I can understand doing an equals check in the beginning, to see if both objects 
are the same reference for efficiency, but I知 not sure if this is actually 
comparing them.  Here is a relevant SO link: 
http://stackoverflow.com/a/12263778/328397


      public override bool Equals(
            object obj)
        {
            if (obj == this)   ///覧 Warning HERE
                return true;

            BigInteger biggie = obj as BigInteger;
            if (biggie == null)
                return false;

            return sign == biggie.sign && IsEqualMagnitude(biggie);
        }


      private bool IsEqualMagnitude(BigInteger x)
        {
            int[] xMag = x.magnitude;  // xMag is assigned but never used
            if (magnitude.Length != x.magnitude.Length)
                return false;
            for (int i = 0; i < magnitude.Length; i++)
            {
                if (magnitude[i] != x.magnitude[i])
                    return false;
            }
            return true;
        }

**********************************************************************
This e-mail may contain information that is privileged, confidential or 
protected under state or federal law. If you are not an intended recipient of 
this email, please delete it, notify the sender immediately, and do not copy, 
use or disseminate any information in the e-mail. Any tax advice in this email 
may not be used to avoid any penalties imposed under U.S. tax laws. E-mail sent 
to or from this e-mail address may be monitored, reviewed and archived.

Reply via email to