mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-22 06:45:11 +00:00
Reduce use of GetName and SetName, prefer direct
This commit is contained in:
@@ -507,7 +507,7 @@ namespace SabreTools.Metadata.DatFiles
|
||||
if (!string.IsNullOrEmpty(sha1))
|
||||
{
|
||||
name = Utilities.GetDepotPath(sha1, Modifiers.OutputDepot.Depth)?.Replace('\\', '/');
|
||||
item.SetName($"{pre}{name}{post}");
|
||||
disk.Name = $"{pre}{name}{post}";
|
||||
}
|
||||
}
|
||||
else if (item is DatItems.Formats.File file)
|
||||
@@ -517,7 +517,7 @@ namespace SabreTools.Metadata.DatFiles
|
||||
if (!string.IsNullOrEmpty(sha1))
|
||||
{
|
||||
name = Utilities.GetDepotPath(sha1, Modifiers.OutputDepot.Depth)?.Replace('\\', '/');
|
||||
item.SetName($"{pre}{name}{post}");
|
||||
file.SetName($"{pre}{name}{post}");
|
||||
}
|
||||
}
|
||||
else if (item is Media media)
|
||||
@@ -527,7 +527,7 @@ namespace SabreTools.Metadata.DatFiles
|
||||
if (!string.IsNullOrEmpty(sha1))
|
||||
{
|
||||
name = Utilities.GetDepotPath(sha1, Modifiers.OutputDepot.Depth)?.Replace('\\', '/');
|
||||
item.SetName($"{pre}{name}{post}");
|
||||
media.Name = $"{pre}{name}{post}";
|
||||
}
|
||||
}
|
||||
else if (item is Rom rom)
|
||||
@@ -537,7 +537,7 @@ namespace SabreTools.Metadata.DatFiles
|
||||
if (!string.IsNullOrEmpty(sha1))
|
||||
{
|
||||
name = Utilities.GetDepotPath(sha1, Modifiers.OutputDepot.Depth)?.Replace('\\', '/');
|
||||
item.SetName($"{pre}{name}{post}");
|
||||
rom.Name = $"{pre}{name}{post}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace SabreTools.Metadata.DatFiles.Formats
|
||||
if (Modifiers.OutputDepot?.IsActive == true || Modifiers.UseRomName)
|
||||
sw.Write($"{datItem.GetName() ?? string.Empty}\n");
|
||||
else if (!Modifiers.UseRomName && machine!.Name != lastgame)
|
||||
sw.Write($"{machine!.GetName() ?? string.Empty}\n");
|
||||
sw.Write($"{machine!.Name ?? string.Empty}\n");
|
||||
|
||||
sw.Flush();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user