Skip to content

Commit 23e35d7

Browse files
authored
Merge pull request #1202 from pkasting/main
[jumbo] Add begin()/end() to Slice.
2 parents eb31d19 + 2cc36eb commit 23e35d7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/leveldb/slice.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ class LEVELDB_EXPORT Slice {
5151
// Return true iff the length of the referenced data is zero
5252
bool empty() const { return size_ == 0; }
5353

54+
const char* begin() const { return data(); }
55+
const char* end() const { return data() + size(); }
56+
5457
// Return the ith byte in the referenced data.
5558
// REQUIRES: n < size()
5659
char operator[](size_t n) const {

0 commit comments

Comments
 (0)