BSON OrderedHash .hash function gives a different result than ruby's Hash .hash function

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • 1.4.0
    • Affects Version/s: 1.2.4
    • Component/s: None
    • Environment:
      Ubuntu 10.04
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      >> h = Hash[

      {"a" => 1}]
      => {"a"=>1}
      >> oh = BSON::OrderedHash[{"a" => 1}

      ]
      =>

      {"a"=>1}

      >> h.eql? oh
      => true
      >> h.hash.eql? oh.hash
      => false
      >> h.hash.eql? Hash[oh].hash
      => true

      Is this behavior intentional? It complicates code where hashes are being used as hash keys.

            Assignee:
            Kyle Banker (Inactive)
            Reporter:
            Ryan Cooke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: