Merge pull request #1249 from victorvianna:main
Some checks failed
ci / CI ${{ matrix.os }} ${{ matrix.compiler }} ${{ matrix.optimized && 'release' || 'debug' }} (<nil>, <nil>, msvc, false, windows-latest) (push) Has been cancelled
ci / CI ${{ matrix.os }} ${{ matrix.compiler }} ${{ matrix.optimized && 'release' || 'debug' }} (<nil>, <nil>, msvc, true, windows-latest) (push) Has been cancelled
ci / CI ${{ matrix.os }} ${{ matrix.compiler }} ${{ matrix.optimized && 'release' || 'debug' }} (clang, clang++, clang, false, macos-latest) (push) Has been cancelled
ci / CI ${{ matrix.os }} ${{ matrix.compiler }} ${{ matrix.optimized && 'release' || 'debug' }} (clang, clang++, clang, false, ubuntu-latest) (push) Has been cancelled
ci / CI ${{ matrix.os }} ${{ matrix.compiler }} ${{ matrix.optimized && 'release' || 'debug' }} (clang, clang++, clang, true, macos-latest) (push) Has been cancelled
ci / CI ${{ matrix.os }} ${{ matrix.compiler }} ${{ matrix.optimized && 'release' || 'debug' }} (clang, clang++, clang, true, ubuntu-latest) (push) Has been cancelled
ci / CI ${{ matrix.os }} ${{ matrix.compiler }} ${{ matrix.optimized && 'release' || 'debug' }} (gcc, g++, gcc, false, ubuntu-latest) (push) Has been cancelled
ci / CI ${{ matrix.os }} ${{ matrix.compiler }} ${{ matrix.optimized && 'release' || 'debug' }} (gcc, g++, gcc, true, ubuntu-latest) (push) Has been cancelled

PiperOrigin-RevId: 721407764
This commit is contained in:
Victor Costan 2025-01-30 09:32:59 -08:00
commit ac691084fd
2 changed files with 4 additions and 1 deletions

View File

@ -51,6 +51,9 @@ class LEVELDB_EXPORT Slice {
// Return true iff the length of the referenced data is zero // Return true iff the length of the referenced data is zero
bool empty() const { return size_ == 0; } bool empty() const { return size_ == 0; }
const char* begin() const { return data(); }
const char* end() const { return data() + size(); }
// Return the ith byte in the referenced data. // Return the ith byte in the referenced data.
// REQUIRES: n < size() // REQUIRES: n < size()
char operator[](size_t n) const { char operator[](size_t n) const {

View File

@ -27,7 +27,7 @@ uint32_t Hash(const char* data, size_t n, uint32_t seed) {
uint32_t h = seed ^ (n * m); uint32_t h = seed ^ (n * m);
// Pick up four bytes at a time // Pick up four bytes at a time
while (data + 4 <= limit) { while (limit - data >= 4) {
uint32_t w = DecodeFixed32(data); uint32_t w = DecodeFixed32(data);
data += 4; data += 4;
h += w; h += w;