[fix] 修复当有两个input文件内容完全相同的情况下,TableDataInfo::BuildIndexs 抛出key重复异常的bug

main
walon 2022-06-01 17:02:06 +08:00
parent 9b086767a1
commit f756ab2aa2
1 changed files with 8 additions and 2 deletions

View File

@ -44,13 +44,19 @@ namespace Luban.Job.Cfg.Defs
var overrideRecords = new HashSet<Record>(); var overrideRecords = new HashSet<Record>();
foreach (var r in mainRecords) foreach (var r in mainRecords)
{ {
recordIndex.Add(r, index++); if (recordIndex.TryAdd(r, index))
{
index++;
}
} }
if (patchRecords != null) if (patchRecords != null)
{ {
foreach (var r in patchRecords) foreach (var r in patchRecords)
{ {
recordIndex.Add(r, index++); if (recordIndex.TryAdd(r, index))
{
index++;
}
} }
} }