Browse Source

Merge pull request #1202 from pkasting/main

[jumbo] Add begin()/end() to Slice.
naive_version
Austin Sullivan 3 months ago
committed by GitHub
parent
commit
23e35d792b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      include/leveldb/slice.h

+ 3
- 0
include/leveldb/slice.h 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 {

Loading…
Cancel
Save