Share absl smart_ptr hash function across query stats Key classes

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      These two hash functions were duplicated in every Key implementation. Move them to a global function that supports every subclass of Key and delete the duplicates.

          template <typename H>
          friend H AbslHashValue(H h, const std::unique_ptr<const AggKey>& key) {
              return H::combine(std::move(h), *key);
          }
          template <typename H>
          friend H AbslHashValue(H h, const std::shared_ptr<const AggKey>& key) {
              return H::combine(std::move(h), *key);
          } 

      Broken out from work on SERVER-127269 

            Assignee:
            Anna Veselova
            Reporter:
            Anna Veselova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: