1
0
mirror of https://github.com/google/leveldb.git synced 2025-04-25 14:00:27 +08:00
This commit is contained in:
dryrun 2025-02-06 16:26:46 +08:00 committed by GitHub
commit b0b7340d24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -108,7 +108,7 @@ bool GetVarint32(Slice* input, uint32_t* value) {
if (q == nullptr) {
return false;
} else {
*input = Slice(q, limit - q);
input->remove_prefix(q - p);
return true;
}
}
@ -137,7 +137,7 @@ bool GetVarint64(Slice* input, uint64_t* value) {
if (q == nullptr) {
return false;
} else {
*input = Slice(q, limit - q);
input->remove_prefix(q - p);
return true;
}
}

View File

@ -92,7 +92,7 @@ TEST(Coding, Varint32) {
ASSERT_EQ(expected, actual);
ASSERT_EQ(VarintLength(actual), p - start);
}
ASSERT_EQ(p, s.data() + s.size());
ASSERT_EQ(p, limit);
}
TEST(Coding, Varint64) {