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 />
public override int GetHashCode()
{
var hash = HashCodeCombiner.Start();
hash.Add(Key, StringComparer.OrdinalIgnoreCase);
hash.Add(IsModelSet);
hash.Add(Model);
return hash.CombinedHash;
var hashCodeCombiner = HashCodeCombiner.Start();
hashCodeCombiner.Add(Key, StringComparer.OrdinalIgnoreCase);
hashCodeCombiner.Add(IsModelSet);
hashCodeCombiner.Add(Model);
return hashCodeCombiner.CombinedHash;
}
/// <inheritdoc />

View File

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

View File

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