Remove chaining from HashCodeCombiner.

Reacting to https://github.com/aspnet/Common/issues/40
This commit is contained in:
Pranav K 2015-09-21 16:12:03 -07:00
parent 8f3a322cf9
commit 498d209949
3 changed files with 13 additions and 12 deletions

View File

@ -131,11 +131,12 @@ namespace Microsoft.AspNet.Mvc.ModelBinding
/// <inheritdoc /> /// <inheritdoc />
public override int GetHashCode() public override int GetHashCode()
{ {
var hash = HashCodeCombiner.Start(); var hashCodeCombiner = HashCodeCombiner.Start();
hash.Add(Key, StringComparer.OrdinalIgnoreCase); hashCodeCombiner.Add(Key, StringComparer.OrdinalIgnoreCase);
hash.Add(IsModelSet); hashCodeCombiner.Add(IsModelSet);
hash.Add(Model); hashCodeCombiner.Add(Model);
return hash.CombinedHash;
return hashCodeCombiner.CombinedHash;
} }
/// <inheritdoc /> /// <inheritdoc />

View File

@ -82,10 +82,11 @@ namespace Microsoft.AspNet.Mvc.Razor.Precompilation
public override int GetHashCode() public override int GetHashCode()
{ {
return HashCodeCombiner var hashCodeCombiner = HashCodeCombiner.Start();
.Start() hashCodeCombiner.Add(Configuration);
.Add(Configuration) hashCodeCombiner.Add(TargetFramework);
.Add(TargetFramework);
return hashCodeCombiner;
} }
} }
} }

View File

@ -109,9 +109,8 @@ namespace Microsoft.AspNet.Mvc.Razor
/// <inheritdoc /> /// <inheritdoc />
public override int GetHashCode() public override int GetHashCode()
{ {
var hashCodeCombiner = HashCodeCombiner.Start() var hashCodeCombiner = HashCodeCombiner.Start();
.Add(IsFoundResult); hashCodeCombiner.Add(IsFoundResult);
if (IsFoundResult) if (IsFoundResult)
{ {