diff options
author | Austin Sullivan <asully@chromium.org> | 2024-08-23 09:56:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-23 09:56:43 -0700 |
commit | 23e35d792b9154f922b8b575b12596a4d8664c65 (patch) | |
tree | 5bf1f370df69198af6c3d296f0fdf3f1eafeba82 | |
parent | eb31d19999fdf2018df4ae815a0fe130dd407532 (diff) | |
parent | 2cc36eb56668306c64fc611fb7ad63ecf0b20379 (diff) | |
download | leveldb-23e35d792b9154f922b8b575b12596a4d8664c65.tar.gz leveldb-23e35d792b9154f922b8b575b12596a4d8664c65.zip |
Merge pull request #1202 from pkasting/main
[jumbo] Add begin()/end() to Slice.
-rw-r--r-- | include/leveldb/slice.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/leveldb/slice.h b/include/leveldb/slice.h index 37cb821..e97223a 100644 --- a/include/leveldb/slice.h +++ b/include/leveldb/slice.h @@ -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 { |