Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17b9ef2e authored by Christopher Wiley's avatar Christopher Wiley
Browse files

Remove dependency on base::Hash

This function is changing to just use std::hash anyway.  This is
slightly less efficient because of the copies, but doing it inline
makes the cost more explicit to bluetooth authors.

Bug: 26253162
Change-Id: I940ea8ce8aa27808cef8a8b9398a7756db3b5ca3
Test: Compiles
parent 72550d3c
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -19,7 +19,8 @@
#include <array>
#include <string>

#include <base/hash.h>
// TODO: Find places that break include what you use and remove this.
#include <base/logging.h>
#include <hardware/bluetooth.h>

namespace bluetooth {
@@ -101,9 +102,8 @@ template<>
struct hash<bluetooth::UUID> {
  std::size_t operator()(const bluetooth::UUID& key) const {
    const auto& uuid_bytes = key.GetFullBigEndian();

    return base::Hash(reinterpret_cast<const char*>(uuid_bytes.data()),
                      uuid_bytes.size());
    std::hash<std::string> hash_fn;
    return hash_fn(std::string((char *)uuid_bytes.data(), uuid_bytes.size()));
  }
};