提交 468b9cf3 编写于 作者: M Manish Vasani

Address feedback

上级 c7000f23
......@@ -30,26 +30,23 @@ public TableItem(T item, Func<T, int> keyGenerator)
public TableItem(IEnumerable<TableItem<T>> items)
{
var itemCount = items.Count();
if (itemCount == 0)
var first = true;
var collectionHash = 1;
var count = 0;
// Make things to be deterministic.
var orderedItems = items.Where(i => i.PrimaryDocumentId != null).OrderBy(i => i.PrimaryDocumentId.Id).ToList();
if (orderedItems.Count == 0)
{
// There must be at least 1 item in the list
FatalError.ReportWithoutCrash(new ArgumentException("Contains no items", nameof(items)));
}
var filteredItems = items.Where(i => i.PrimaryDocumentId != null);
if (filteredItems.Count() != itemCount)
else if (orderedItems.Count != items.Count())
{
// There must be document id for provided items.
FatalError.ReportWithoutCrash(new ArgumentException("Contains an item with null PrimaryDocumentId", nameof(items)));
}
var first = true;
var collectionHash = 1;
var count = 0;
// Make things to be deterministic.
var orderedItems = filteredItems.OrderBy(i => i.PrimaryDocumentId.Id);
foreach (var item in orderedItems)
{
count++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册