summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libziparchive/zip_archive.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/libziparchive/zip_archive.cc b/libziparchive/zip_archive.cc
index 35d0f0b6a..6da5c99bd 100644
--- a/libziparchive/zip_archive.cc
+++ b/libziparchive/zip_archive.cc
@@ -100,6 +100,11 @@ static uint32_t RoundUpPower2(uint32_t val) {
100} 100}
101 101
102static uint32_t ComputeHash(const ZipString& name) { 102static uint32_t ComputeHash(const ZipString& name) {
103#if !defined(_WIN32)
104 return std::hash<std::string_view>{}(
105 std::string_view(reinterpret_cast<const char*>(name.name), name.name_length));
106#else
107 // Remove this code path once the windows compiler knows how to compile the above statement.
103 uint32_t hash = 0; 108 uint32_t hash = 0;
104 uint16_t len = name.name_length; 109 uint16_t len = name.name_length;
105 const uint8_t* str = name.name; 110 const uint8_t* str = name.name;
@@ -109,6 +114,7 @@ static uint32_t ComputeHash(const ZipString& name) {
109 } 114 }
110 115
111 return hash; 116 return hash;
117#endif
112} 118}
113 119
114/* 120/*