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

Commit 0e58cf60 authored by Jack He's avatar Jack He Committed by android-build-merger
Browse files

Address: Add static assert to make sure kLength is <= sizeof(uint64_t) am:...

Address: Add static assert to make sure kLength is <= sizeof(uint64_t) am: 875a02a2 am: fd61539e am: f17cacb7 am: 7d018ec7
am: 0e285754

Change-Id: If202d188685ebf8bf4d1665acf8efe9d4000c954
parents eef6a3f0 0e285754
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ namespace std {
template <>
struct hash<bluetooth::common::Address> {
  std::size_t operator()(const bluetooth::common::Address& val) const {
    static_assert(sizeof(uint64_t) >= bluetooth::common::Address::kLength);
    uint64_t int_addr = 0;
    memcpy(reinterpret_cast<uint8_t*>(&int_addr), val.address, bluetooth::common::Address::kLength);
    return std::hash<uint64_t>{}(int_addr);