voidstar69 commented on code in PR #41539:
URL: https://github.com/apache/arrow/pull/41539#discussion_r1597482051
##########
csharp/src/Apache.Arrow/Arrays/PrimitiveArray.cs:
##########
@@ -86,5 +86,30 @@ IEnumerator IEnumerable.GetEnumerator()
yield return IsValid(index) ? Values[index] : null;
}
}
+
+ int ICollection<T?>.Count => Length;
+ bool ICollection<T?>.IsReadOnly => true;
+ void ICollection<T?>.Add(T? item) => throw new
NotSupportedException("Collection is read-only.");
+ bool ICollection<T?>.Remove(T? item) => throw new
NotSupportedException("Collection is read-only.");
+ void ICollection<T?>.Clear() => throw new
NotSupportedException("Collection is read-only.");
+
+ bool ICollection<T?>.Contains(T? item)
Review Comment:
I have implemented this type restriction, and used a (hopefully correct)
simplified version of your code snippet above. Let's discuss whether this type
restriction is desirable and worth it for the potential performance improvement
(which I have not benchmarked).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]