Skip to content

Commit c5630b0

Browse files
committed
Use HashCodeCombiner.Start
1 parent 4b8a972 commit c5630b0

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

src/Razor/Microsoft.AspNetCore.Razor.Language/src/DefaultRazorDiagnostic.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System;
@@ -69,7 +69,7 @@ public override bool Equals(RazorDiagnostic obj)
6969

7070
public override int GetHashCode()
7171
{
72-
var hash = new HashCodeCombiner();
72+
var hash = HashCodeCombiner.Start();
7373
hash.Add(Descriptor.GetHashCode());
7474
hash.Add(Span.GetHashCode());
7575

src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public virtual bool Equals(RazorConfiguration other)
9494

9595
public override int GetHashCode()
9696
{
97-
var hash = new HashCodeCombiner();
97+
var hash = HashCodeCombiner.Start();
9898
hash.Add(LanguageVersion);
9999
hash.Add(ConfigurationName);
100100

src/Razor/Microsoft.AspNetCore.Razor.Language/src/SourceChange.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public override bool Equals(object obj)
125125

126126
public override int GetHashCode()
127127
{
128-
var hash = new HashCodeCombiner();
128+
var hash = HashCodeCombiner.Start();
129129
hash.Add(Span);
130130
hash.Add(NewText, StringComparer.Ordinal);
131131
return hash;

src/Razor/Microsoft.AspNetCore.Razor.Language/src/Syntax/TextSpan.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public override bool Equals(object obj)
229229
/// </summary>
230230
public override int GetHashCode()
231231
{
232-
var combiner = new HashCodeCombiner();
232+
var combiner = HashCodeCombiner.Start();
233233
combiner.Add(Start);
234234
combiner.Add(Length);
235235

src/Razor/Microsoft.AspNetCore.Razor.Language/test/HashCodeCombinerTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ public class HashCodeCombinerTest
1010
[Fact]
1111
public void GivenTheSameInputs_ItProducesTheSameOutput()
1212
{
13-
var hashCode1 = new HashCodeCombiner();
14-
var hashCode2 = new HashCodeCombiner();
13+
var hashCode1 = HashCodeCombiner.Start();
14+
var hashCode2 = HashCodeCombiner.Start();
1515

1616
hashCode1.Add(42);
1717
hashCode1.Add("foo");

src/Razor/Microsoft.CodeAnalysis.Razor/src/AssemblyIdentityEqualityComparer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System;
@@ -40,7 +40,7 @@ public override int GetHashCode(AssemblyIdentity obj)
4040
return 0;
4141
}
4242

43-
var hash = new HashCodeCombiner();
43+
var hash = HashCodeCombiner.Start();
4444
hash.Add(obj.Name, StringComparer.OrdinalIgnoreCase);
4545
hash.Add(obj.Version);
4646
return hash;

0 commit comments

Comments
 (0)