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

Commit 957dc094 authored by Elliott Hughes's avatar Elliott Hughes Committed by android-build-merger
Browse files

Merge "use std::hash instead of hashing byte by byte" am: aaa0bbce

am: bfb96796

Change-Id: Ib0cd0e44e34aecbf8af1ccd83c96eb3ebeb71978
parents bfd61d6a bfb96796
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -100,6 +100,11 @@ static uint32_t RoundUpPower2(uint32_t val) {
}

static uint32_t ComputeHash(const ZipString& name) {
#if !defined(_WIN32)
  return std::hash<std::string_view>{}(
      std::string_view(reinterpret_cast<const char*>(name.name), name.name_length));
#else
  // Remove this code path once the windows compiler knows how to compile the above statement.
  uint32_t hash = 0;
  uint16_t len = name.name_length;
  const uint8_t* str = name.name;
@@ -109,6 +114,7 @@ static uint32_t ComputeHash(const ZipString& name) {
  }

  return hash;
#endif
}

/*