Skip to content

Commit

Permalink
Merge pull request #1249 from victorvianna:main
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 721407764
  • Loading branch information
pwnall committed Jan 30, 2025
2 parents e829478 + 4ee78d7 commit ac69108
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions include/leveldb/slice.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ class LEVELDB_EXPORT Slice {
// Return true iff the length of the referenced data is zero
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.
// REQUIRES: n < size()
char operator[](size_t n) const {
Expand Down
2 changes: 1 addition & 1 deletion util/hash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ac69108

Please sign in to comment.