Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Span<T> equality

Span<T> equality

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpjavascriptcomjsonperformance
3 Posts 2 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rob Grainger
    wrote on last edited by
    #1

    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.

    Richard DeemingR 2 Replies Last reply
    0
    • R Rob Grainger

      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.

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      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

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      1 Reply Last reply
      0
      • R Rob Grainger

        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.

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        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

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups