mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-23 07:14:57 +00:00
Reduce use of SetName
This commit is contained in:
@@ -602,7 +602,7 @@ namespace SabreTools.Metadata.DatFiles.Formats
|
||||
{
|
||||
// No game should start with a path separator
|
||||
if (!string.IsNullOrEmpty(datItem.GetMachine()!.Name))
|
||||
datItem.GetMachine()!.SetName(datItem.GetMachine()!.Name!.TrimStart(Path.DirectorySeparatorChar));
|
||||
datItem.GetMachine()!.Name = datItem.GetMachine()!.Name!.TrimStart(Path.DirectorySeparatorChar);
|
||||
|
||||
// Build the state
|
||||
jtw.WriteStartObject();
|
||||
|
||||
@@ -429,7 +429,7 @@ namespace SabreTools.Metadata.DatFiles.Formats
|
||||
private static void WriteStartGame(XmlTextWriter xtw, DatItem datItem)
|
||||
{
|
||||
// No game should start with a path separator
|
||||
datItem.GetMachine()!.SetName(datItem.GetMachine()!.Name?.TrimStart(Path.DirectorySeparatorChar) ?? string.Empty);
|
||||
datItem.GetMachine()!.Name = datItem.GetMachine()!.Name?.TrimStart(Path.DirectorySeparatorChar) ?? string.Empty;
|
||||
|
||||
// Write the machine
|
||||
xtw.WriteStartElement("directory");
|
||||
|
||||
Reference in New Issue
Block a user