Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,8 @@ private void HandleNext(object value, NextInfo info, int size)

internal abstract (AllowedRecordTypes allowed, PrimitiveType primitiveType) GetAllowedRecordType();

/// <summary>
/// Checks that the number of records matches the number of array elements when an exact count is expected.
/// </summary>
/// <remarks>
/// Every record represents a single value, except for the Multiple Null Records which represent more than one null.
/// When nulls are allowed, Multiple Null Records are permitted and the record count is not expected to match the total element count.
/// It's important to perform this check before allocating the array, as the array can be very large.
/// </remarks>
// Every record represents a single value, except for the Multiple Null Records which represent more than one null.
// When nulls are allowed, Multiple Null Records are permitted and the record count is not expected to match the total element count.
Comment on lines +117 to +118

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a comment required at all?

If anything, just keep it simple.

// Other than multiple-null, every record represents one object.
// So for null-disallowed, we can do a quick check to avoid unnecessary work.

But my recommendation is just to delete the comment altogether.

private protected void CheckExpectedRecordCount(List<SerializationRecord> records, bool allowNulls)
{
if (!allowNulls && ArrayInfo.FlattenedLength != records.Count)
Expand Down
Loading