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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user