Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing bad rebase. dumb line endings...
- Loading branch information
Showing
1 changed file
with
37 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,47 @@ | ||
<<<<<<< HEAD | ||
using System; | ||
|
||
namespace AutoMapper.Internal | ||
{ | ||
internal struct TypePair : IEquatable<TypePair> | ||
{ | ||
|
||
public TypePair(Type sourceType, Type destinationType) | ||
: this() | ||
{ | ||
_sourceType = sourceType; | ||
_destinationType = destinationType; | ||
_hashcode = unchecked((_sourceType.GetHashCode()*397) ^ _destinationType.GetHashCode()); | ||
} | ||
|
||
private readonly Type _destinationType; | ||
private readonly int _hashcode; | ||
private readonly Type _sourceType; | ||
|
||
public Type SourceType | ||
{ | ||
get { return _sourceType; } | ||
} | ||
|
||
public Type DestinationType | ||
{ | ||
get { return _destinationType; } | ||
} | ||
|
||
public bool Equals(TypePair other) | ||
{ | ||
return Equals(other._sourceType, _sourceType) && Equals(other._destinationType, _destinationType); | ||
} | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
if (ReferenceEquals(null, obj)) return false; | ||
if (obj.GetType() != typeof (TypePair)) return false; | ||
return Equals((TypePair) obj); | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return _hashcode; | ||
} | ||
} | ||
} | ||
======= | ||
using System; | ||
|
||
namespace AutoMapper.Internal | ||
{ | ||
internal struct TypePair : IEquatable<TypePair> | ||
{ | ||
internal struct TypePair : IEquatable<TypePair> | ||
{ | ||
|
||
public TypePair(Type sourceType, Type destinationType) | ||
: this() | ||
{ | ||
_sourceType = sourceType; | ||
_destinationType = destinationType; | ||
_hashcode = unchecked((_sourceType.GetHashCode()*397) ^ _destinationType.GetHashCode()); | ||
} | ||
public TypePair(Type sourceType, Type destinationType) | ||
: this() | ||
{ | ||
_sourceType = sourceType; | ||
_destinationType = destinationType; | ||
_hashcode = unchecked((_sourceType.GetHashCode() * 397) ^ _destinationType.GetHashCode()); | ||
} | ||
|
||
private readonly Type _destinationType; | ||
private readonly int _hashcode; | ||
private readonly Type _sourceType; | ||
|
||
public Type SourceType | ||
{ | ||
get { return _sourceType; } | ||
} | ||
|
||
public Type DestinationType | ||
{ | ||
get { return _destinationType; } | ||
} | ||
|
||
public bool Equals(TypePair other) | ||
{ | ||
return Equals(other._sourceType, _sourceType) && Equals(other._destinationType, _destinationType); | ||
} | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
if (ReferenceEquals(null, obj)) return false; | ||
if (obj.GetType() != typeof (TypePair)) return false; | ||
return Equals((TypePair) obj); | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return _hashcode; | ||
} | ||
} | ||
} | ||
>>>>>>> 405eb8b... GetHashCode() returns a precalculated value in an unchecked context. Have put the calculation back into a checked context. | ||
public Type SourceType | ||
{ | ||
get { return _sourceType; } | ||
} | ||
|
||
public Type DestinationType | ||
{ | ||
get { return _destinationType; } | ||
} | ||
|
||
public bool Equals(TypePair other) | ||
{ | ||
return Equals(other._sourceType, _sourceType) && Equals(other._destinationType, _destinationType); | ||
} | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
if (ReferenceEquals(null, obj)) return false; | ||
if (obj.GetType() != typeof(TypePair)) return false; | ||
return Equals((TypePair)obj); | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return _hashcode; | ||
} | ||
} | ||
} |