[DatFile] Reset the dictionary means reset the sort

This commit is contained in:
Matt Nadareski
2018-03-13 15:36:38 -07:00
parent bf84a2a218
commit 06959a8970

View File

@@ -2027,8 +2027,6 @@ namespace SabreTools.Library.DatFiles
/// <param name="skip">True if the first cascaded diff file should be skipped on output, false otherwise</param> /// <param name="skip">True if the first cascaded diff file should be skipped on output, false otherwise</param>
public void DiffCascade(List<string> inputs, List<DatFile> datHeaders, string outDir, bool inplace, bool skip) public void DiffCascade(List<string> inputs, List<DatFile> datHeaders, string outDir, bool inplace, bool skip)
{ {
string post = "";
// Create a list of DatData objects representing output files // Create a list of DatData objects representing output files
List<DatFile> outDats = new List<DatFile>(); List<DatFile> outDats = new List<DatFile>();
@@ -2050,12 +2048,12 @@ namespace SabreTools.Library.DatFiles
else else
{ {
diffData = new DatFile(this); diffData = new DatFile(this);
diffData.FileName += post; diffData.FileName += innerpost;
diffData.Name += post; diffData.Name += innerpost;
diffData.Description += post; diffData.Description += innerpost;
} }
diffData.ResetDictionary();
diffData.ResetDictionary();
outDatsArray[j] = diffData; outDatsArray[j] = diffData;
}); });
@@ -2388,6 +2386,8 @@ namespace SabreTools.Library.DatFiles
public void DeleteDictionary() public void DeleteDictionary()
{ {
_items = null; _items = null;
_sortedBy = SortedBy.Default;
_mergedBy = DedupeType.None;
// Reset statistics // Reset statistics
_datStats.Reset(); _datStats.Reset();
@@ -2399,6 +2399,8 @@ namespace SabreTools.Library.DatFiles
public void ResetDictionary() public void ResetDictionary()
{ {
_items = new SortedDictionary<string, List<DatItem>>(); _items = new SortedDictionary<string, List<DatItem>>();
_sortedBy = SortedBy.Default;
_mergedBy = DedupeType.None;
// Reset statistics // Reset statistics
_datStats.Reset(); _datStats.Reset();