diff options
author | lingbin <lingbinlb@gmail.com> | 2017-09-04 16:10:38 +0800 |
---|---|---|
committer | lingbin <lingbinlb@gmail.com> | 2017-09-04 16:10:38 +0800 |
commit | 3ee04c5ceae6535e922521ed940411a0318fdd3b (patch) | |
tree | 52a9a8856b1bd0b63d360b200bfd736baa54b13a | |
parent | 09a3c8e7417547829b94bcdaa62cdf9e896f29a9 (diff) | |
download | leveldb-3ee04c5ceae6535e922521ed940411a0318fdd3b.tar.gz leveldb-3ee04c5ceae6535e922521ed940411a0318fdd3b.zip |
fix style and remove unused code
-rw-r--r-- | util/coding.cc | 10 | ||||
-rw-r--r-- | util/coding.h | 4 |
2 files changed, 2 insertions, 12 deletions
diff --git a/util/coding.cc b/util/coding.cc index 21e3186..c37b24a 100644 --- a/util/coding.cc +++ b/util/coding.cc @@ -169,16 +169,6 @@ bool GetVarint64(Slice* input, uint64_t* value) { } } -const char* GetLengthPrefixedSlice(const char* p, const char* limit, - Slice* result) { - uint32_t len; - p = GetVarint32Ptr(p, limit, &len); - if (p == NULL) return NULL; - if (p + len > limit) return NULL; - *result = Slice(p, len); - return p + len; -} - bool GetLengthPrefixedSlice(Slice* input, Slice* result) { uint32_t len; if (GetVarint32(input, &len) && diff --git a/util/coding.h b/util/coding.h index 3993c4a..8582d90 100644 --- a/util/coding.h +++ b/util/coding.h @@ -35,8 +35,8 @@ extern bool GetLengthPrefixedSlice(Slice* input, Slice* result); // in *v and return a pointer just past the parsed value, or return // NULL on error. These routines only look at bytes in the range // [p..limit-1] -extern const char* GetVarint32Ptr(const char* p,const char* limit, uint32_t* v); -extern const char* GetVarint64Ptr(const char* p,const char* limit, uint64_t* v); +extern const char* GetVarint32Ptr(const char* p, const char* limit, uint32_t* v); +extern const char* GetVarint64Ptr(const char* p, const char* limit, uint64_t* v); // Returns the length of the varint32 or varint64 encoding of "v" extern int VarintLength(uint64_t v); |