initialize decoded_internal_key_valid

Summary:
ReadInternalKey() will assign correct value anyway. Initialize it to
true to suppress compiler error reported
https://github.com/facebook/rocksdb/issues/186

Test Plan: I cannot reproduce it but this is obvious

Reviewers: sdong, yhchiang

Reviewed By: yhchiang

Subscribers: leveldb

Differential Revision: https://reviews.facebook.net/D19467
This commit is contained in:
Lei Jin 2014-07-03 23:13:08 -07:00
parent d33657a4a5
commit 8d9a46fcd1

View File

@ -198,7 +198,8 @@ Status PlainTableKeyDecoder::NextPlainEncodingKey(
user_key_size = static_cast<size_t>(tmp_size); user_key_size = static_cast<size_t>(tmp_size);
*bytes_read = key_ptr - start; *bytes_read = key_ptr - start;
} }
bool decoded_internal_key_valid; // dummy initial value to avoid compiler complain
bool decoded_internal_key_valid = true;
Slice decoded_internal_key; Slice decoded_internal_key;
Status s = Status s =
ReadInternalKey(key_ptr, limit, user_key_size, parsed_key, bytes_read, ReadInternalKey(key_ptr, limit, user_key_size, parsed_key, bytes_read,
@ -227,7 +228,8 @@ Status PlainTableKeyDecoder::NextPrefixEncodingKey(
bool expect_suffix = false; bool expect_suffix = false;
do { do {
size_t size = 0; size_t size = 0;
bool decoded_internal_key_valid; // dummy initial value to avoid compiler complain
bool decoded_internal_key_valid = true;
const char* pos = DecodeSize(key_ptr, limit, &entry_type, &size); const char* pos = DecodeSize(key_ptr, limit, &entry_type, &size);
if (pos == nullptr) { if (pos == nullptr) {
return Status::Corruption("Unexpected EOF when reading size of the key"); return Status::Corruption("Unexpected EOF when reading size of the key");