Skip to content

Commit

Permalink
Use GetValueOrDefault
Browse files Browse the repository at this point in the history
  • Loading branch information
trejjam committed Dec 5, 2023
1 parent 2003e70 commit 2d829e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ public void AddInitMemberMapping(MemberAssignmentMapping mapping)

public void AddConstructorParameterMapping(ConstructorParameterMapping mapping)
{
if (RootTargetNameCasingMapping.TryGetValue(mapping.Parameter.Name, out var parameterName))
{
MemberConfigsByRootTargetName.Remove(parameterName);
}
var paramName = RootTargetNameCasingMapping.GetValueOrDefault(mapping.Parameter.Name, defaultValue: mapping.Parameter.Name);
MemberConfigsByRootTargetName.Remove(paramName);
SetSourceMemberMapped(mapping.DelegateMapping.SourcePath);
Mapping.AddConstructorParameterMapping(mapping);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ public void AddInitMemberMapping(MemberAssignmentMapping mapping)

public void AddConstructorParameterMapping(ConstructorParameterMapping mapping)
{
if (RootTargetNameCasingMapping.TryGetValue(mapping.Parameter.Name, out var parameterName))
{
MemberConfigsByRootTargetName.Remove(parameterName);
}
var paramName = RootTargetNameCasingMapping.GetValueOrDefault(mapping.Parameter.Name, defaultValue: mapping.Parameter.Name);
MemberConfigsByRootTargetName.Remove(paramName);
SetSourceMemberMapped(mapping.DelegateMapping.SourcePath);
Mapping.AddConstructorParameterMapping(mapping);
}
Expand Down

0 comments on commit 2d829e6

Please sign in to comment.