Skip to content

Commit 661b7d3

Browse files
Merge pull request #25 from westermo/performance
Refactor: Remove Symbol references earlier
2 parents a6b46f4 + a971868 commit 661b7d3

File tree

6 files changed

+694
-435
lines changed

6 files changed

+694
-435
lines changed

Benchmarking/Benchmarks/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace Benchmarks;
99

10+
[MemoryDiagnoser]
1011
[JsonExporterAttribute.Full]
1112
[JsonExporterAttribute.FullCompressed]
1213
public class ResolveBenchmarks

FactoryGenerator/BooleanInjection.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
using System;
2+
13
namespace FactoryGenerator
24
{
3-
public class BooleanInjection
5+
public class BooleanInjection : IEquatable<BooleanInjection>
46
{
57
public BooleanInjection(bool value, string key)
68
{
@@ -10,5 +12,14 @@ public BooleanInjection(bool value, string key)
1012

1113
public bool Value { get; }
1214
public string Key { get; }
15+
16+
public bool Equals(BooleanInjection? other)
17+
{
18+
if (other is null) return false;
19+
return Value == other.Value && Key == other.Key;
20+
}
21+
22+
public override bool Equals(object? obj) => obj is BooleanInjection other && Equals(other);
23+
public override int GetHashCode() => (Value.GetHashCode() * 397) ^ Key.GetHashCode();
1324
}
1425
}

0 commit comments

Comments
 (0)