Browse Source

Fix LevelDB build when asserts are enabled in release builds. (#367)

* Fix LevelDB build when asserts are enabled in release builds.

BUG=https://bugs.chromium.org/p/chromium/issues/detail?id=603166

* fix

* Add comment
main
John Abd-El-Malek 8 years ago
committed by Chris Mumford
parent
commit
a7bff697ba
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      table/format.cc

+ 1
- 2
table/format.cc View File

@ -30,15 +30,14 @@ Status BlockHandle::DecodeFrom(Slice* input) {
} }
void Footer::EncodeTo(std::string* dst) const { void Footer::EncodeTo(std::string* dst) const {
#ifndef NDEBUG
const size_t original_size = dst->size(); const size_t original_size = dst->size();
#endif
metaindex_handle_.EncodeTo(dst); metaindex_handle_.EncodeTo(dst);
index_handle_.EncodeTo(dst); index_handle_.EncodeTo(dst);
dst->resize(2 * BlockHandle::kMaxEncodedLength); // Padding dst->resize(2 * BlockHandle::kMaxEncodedLength); // Padding
PutFixed32(dst, static_cast<uint32_t>(kTableMagicNumber & 0xffffffffu)); PutFixed32(dst, static_cast<uint32_t>(kTableMagicNumber & 0xffffffffu));
PutFixed32(dst, static_cast<uint32_t>(kTableMagicNumber >> 32)); PutFixed32(dst, static_cast<uint32_t>(kTableMagicNumber >> 32));
assert(dst->size() == original_size + kEncodedLength); assert(dst->size() == original_size + kEncodedLength);
(void)original_size; // Disable unused variable warning.
} }
Status Footer::DecodeFrom(Slice* input) { Status Footer::DecodeFrom(Slice* input) {

Loading…
Cancel
Save