Dedup release

Summary:
cc tamird sagar0
Closes https://github.com/facebook/rocksdb/pull/2325

Differential Revision: D5098302

Pulled By: sagar0

fbshipit-source-id: 297c5506b5d9b2ed1d7719c8caf0b96cffe503b8
This commit is contained in:
Orgad Shaneh 2017-06-12 13:08:57 -07:00 committed by Facebook Github Bot
parent 27b450165e
commit 9bb91e9328
2 changed files with 13 additions and 24 deletions

View File

@ -1088,19 +1088,14 @@ std::string Env::GenerateUniqueId() {
UuidCreateSequential(&uuid); UuidCreateSequential(&uuid);
RPC_CSTR rpc_str; RPC_CSTR rpc_str;
#ifndef NDEBUG auto status = UuidToStringA(&uuid, &rpc_str);
assert(UuidToStringA(&uuid, &rpc_str) == RPC_S_OK); (void)status;
#else assert(status == RPC_S_OK);
UuidToStringA(&uuid, &rpc_str);
#endif
result = reinterpret_cast<char*>(rpc_str); result = reinterpret_cast<char*>(rpc_str);
#ifndef NDEBUG status = RpcStringFreeA(&rpc_str);
assert(RpcStringFreeA(&rpc_str) == RPC_S_OK); assert(status == RPC_S_OK);
#else
RpcStringFreeA(&rpc_str);
#endif
return result; return result;
} }

View File

@ -194,13 +194,12 @@ WinMmapReadableFile::WinMmapReadableFile(const std::string& fileName,
length_(length) {} length_(length) {}
WinMmapReadableFile::~WinMmapReadableFile() { WinMmapReadableFile::~WinMmapReadableFile() {
#ifndef NDEBUG BOOL ret = ::UnmapViewOfFile(mapped_region_);
assert(::UnmapViewOfFile(mapped_region_)); (void)ret;
assert(::CloseHandle(hMap_)); assert(ret);
#else
::UnmapViewOfFile(mapped_region_); ret = ::CloseHandle(hMap_);
::CloseHandle(hMap_); assert(ret);
#endif
} }
Status WinMmapReadableFile::Read(uint64_t offset, size_t n, Slice* result, Status WinMmapReadableFile::Read(uint64_t offset, size_t n, Slice* result,
@ -747,9 +746,8 @@ Status WinWritableImpl::AppendImpl(const Slice& data) {
assert(data.size() < std::numeric_limits<DWORD>::max()); assert(data.size() < std::numeric_limits<DWORD>::max());
#ifndef NDEBUG
uint64_t written = 0; uint64_t written = 0;
#endif (void)written;
if (file_data_->use_direct_io()) { if (file_data_->use_direct_io()) {
@ -769,9 +767,7 @@ Status WinWritableImpl::AppendImpl(const Slice& data) {
"Failed to pwrite for: " + file_data_->GetName(), lastError); "Failed to pwrite for: " + file_data_->GetName(), lastError);
} }
else { else {
#ifndef NDEBUG
written = ret; written = ret;
#endif
} }
} else { } else {
@ -785,9 +781,7 @@ Status WinWritableImpl::AppendImpl(const Slice& data) {
lastError); lastError);
} }
else { else {
#ifndef NDEBUG
written = bytesWritten; written = bytesWritten;
#endif
} }
} }