mirror of
https://github.com/google/leveldb.git
synced 2026-08-18 10:33:27 +08:00
Reland changes accidentally reverted in 302786e
These changes 1)2cc36eb- "[jumbo] Add begin()/end() to Slice." 2)578eeb7- "Fix invalid pointer arithmetic in Hash (#1222)" were committed in the public repository but never got imported to the internal Google repository. Later, cl/713346733 landed in the internal repo. When tooling published the internal change as302786e("Fix C++23 compilation errors in leveldb"), it accidentally reverted commits (1) and (2). This change re-commits a bundled version of (1) and (2) in the public repo. This will then be imported to the private repo, leaving the 2 in sync.
This commit is contained in:
@@ -27,7 +27,7 @@ uint32_t Hash(const char* data, size_t n, uint32_t seed) {
|
||||
uint32_t h = seed ^ (n * m);
|
||||
|
||||
// Pick up four bytes at a time
|
||||
while (data + 4 <= limit) {
|
||||
while (limit - data >= 4) {
|
||||
uint32_t w = DecodeFixed32(data);
|
||||
data += 4;
|
||||
h += w;
|
||||
|
||||
Reference in New Issue
Block a user