Skip to content

Commit

Permalink
Replaces ReferenceEquals by == operator
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Mar 29, 2024
1 parent deb105d commit d012713
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Pure.DI.Core/Core/Code/ApiMembersBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ private void CreateObjectResolverMethod(
using (code.Indent())
{
code.AppendLine($"ref var pair = ref {Names.BucketsFieldName}[index];");
code.AppendLine("if (ReferenceEquals(pair.Key, type))");
code.AppendLine("if (pair.Key == type)");
code.AppendLine("{");
using (code.Indent())
{
Expand Down
2 changes: 1 addition & 1 deletion src/Pure.DI.Core/Core/Code/BlockCodeBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ variable.Node.Lifetime is Lifetime.Singleton or Lifetime.Scoped
{
var checkExpression = variable.InstanceType.IsValueType
? $"!{parent}{variable.VariableName}Created"
: $"ReferenceEquals({parent}{variable.VariableName}, null)";
: $"{parent}{variable.VariableName} == null";

if (lockIsRequired)
{
Expand Down

0 comments on commit d012713

Please sign in to comment.