Span<T> equality
-
Taking a leaf from JavaScript's clarity of definition for equality, in [Span<T>.Inequality(Span<T>, Span<T>) Operator (System) | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/api/system.span-1.op\_inequality?view=net-7.0) , the following definition of equality seems a bit suspect... "Two Span objects are equal if they have different lengths or if the corresponding elements of left and right do not point to the same memory."
"If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.
-
Taking a leaf from JavaScript's clarity of definition for equality, in [Span<T>.Inequality(Span<T>, Span<T>) Operator (System) | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/api/system.span-1.op\_inequality?view=net-7.0) , the following definition of equality seems a bit suspect... "Two Span objects are equal if they have different lengths or if the corresponding elements of left and right do not point to the same memory."
"If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.
Someone forgot to add "not" when they copied the remarks from the equality operator. :doh:
Span<T>.Equality(Span<T>, Span<T>) Operator (System) | Microsoft Learn[^]
Two
Span<T>
objects are equal if they have the same length and the corresponding elements of left and right point to the same memory.IIRC, there used to be a way to report such problems directly from the page, but it looks like they've abandoned that idea.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Taking a leaf from JavaScript's clarity of definition for equality, in [Span<T>.Inequality(Span<T>, Span<T>) Operator (System) | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/api/system.span-1.op\_inequality?view=net-7.0) , the following definition of equality seems a bit suspect... "Two Span objects are equal if they have different lengths or if the corresponding elements of left and right do not point to the same memory."
"If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.
Managed to find the option to edit the page by creating a pull request on GitHub[^]. The documentation should be correctly shortly. :)
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer