equality operators are always prefered in C#

since the default object.Equals(object) does nothing more than object.ReferenceEquals(object)
This commit is contained in:
Licshee
2016-02-04 12:51:27 +08:00
parent 24609bf53b
commit b08e24c49f
2 changed files with 5 additions and 4 deletions
@@ -145,7 +145,7 @@ namespace ZXing.Common.ReedSolomon
internal GenericGFPoly addOrSubtract(GenericGFPoly other)
{
if (!field.Equals(other.field))
if (field != other.field)
{
throw new ArgumentException("GenericGFPolys do not have same GenericGF field");
}
@@ -181,7 +181,7 @@ namespace ZXing.Common.ReedSolomon
internal GenericGFPoly multiply(GenericGFPoly other)
{
if (!field.Equals(other.field))
if (field != other.field)
{
throw new ArgumentException("GenericGFPolys do not have same GenericGF field");
}
@@ -246,7 +246,7 @@ namespace ZXing.Common.ReedSolomon
internal GenericGFPoly[] divide(GenericGFPoly other)
{
if (!field.Equals(other.field))
if (field != other.field)
{
throw new ArgumentException("GenericGFPolys do not have same GenericGF field");
}
@@ -514,7 +514,8 @@ namespace ZXing.QrCode.Internal
BitArray bits,
String encoding)
{
if (mode.Equals(Mode.BYTE))
// TODO: check the purpose of this .Equals(obj)
if (mode == Mode.BYTE)
append8BitBytes(content, bits, encoding);
else
throw new WriterException("Invalid mode: " + mode);