Browse Source

fix style and remove unused code

main
lingbin 7 years ago
parent
commit
3ee04c5cea
2 changed files with 2 additions and 12 deletions
  1. +0
    -10
      util/coding.cc
  2. +2
    -2
      util/coding.h

+ 0
- 10
util/coding.cc View File

@ -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) { bool GetLengthPrefixedSlice(Slice* input, Slice* result) {
uint32_t len; uint32_t len;
if (GetVarint32(input, &len) && if (GetVarint32(input, &len) &&

+ 2
- 2
util/coding.h View File

@ -35,8 +35,8 @@ extern bool GetLengthPrefixedSlice(Slice* input, Slice* result);
// in *v and return a pointer just past the parsed value, or return // 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 // NULL on error. These routines only look at bytes in the range
// [p..limit-1] // [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" // Returns the length of the varint32 or varint64 encoding of "v"
extern int VarintLength(uint64_t v); extern int VarintLength(uint64_t v);

Loading…
Cancel
Save