Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Modernize switch c++ generator
  • Loading branch information
S0PEX committed Dec 16, 2021
commit be338b4e498d7de99c37b21ec41b42be3a03771e
13 changes: 5 additions & 8 deletions ReClass.NET/CodeGenerator/CppCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -563,15 +563,12 @@ private string GetTypeDefinition(BaseNode node, ILogger logger)
return type;
}

switch (node)
return node switch
{
case ClassInstanceNode classInstanceNode:
return $"class {classInstanceNode.InnerNode.Name}";
case EnumNode enumNode:
return enumNode.Enum.Name;
}

return null;
ClassInstanceNode classInstanceNode => $"class {classInstanceNode.InnerNode.Name}",
EnumNode enumNode => enumNode.Enum.Name,
_ => null,
};
}

/// <summary>
Expand Down