Skip to content

Commit

Permalink
Merge pull request #1202 from pkasting/main
Browse files Browse the repository at this point in the history
[jumbo] Add begin()/end() to Slice.
  • Loading branch information
a-sully authored Aug 23, 2024
2 parents eb31d19 + 2cc36eb commit 23e35d7
Showing 1 changed file with 3 additions and 0 deletions.
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

0 comments on commit 23e35d7

Please sign in to comment.