chore: 优化迭代逻辑

oneRain 2019-11-26 17:35:02 +08:00
parent 3bdf46e5a5
commit 043f8e2d88
1 changed files with 1 additions and 4 deletions

View File

@ -592,10 +592,7 @@ string propertyName
var current = (from item in remaining var current = (from item in remaining
where item.CanBeSerialized where item.CanBeSerialized
select item).ToList(); select item).ToList();
var nextBatch = (from item in remaining remaining = remaining.Except(current).ToList();
where !item.CanBeSerialized
select item).ToList();
remaining = nextBatch;
if (current.Count == 0) { if (current.Count == 0) {
// We do cycle-detection when building the list of objects passed to this // We do cycle-detection when building the list of objects passed to this