From a7478070f39476ccde86bceaa80a1c80df3464b6 Mon Sep 17 00:00:00 2001 From: jsteemann Date: Mon, 8 Nov 2021 12:31:22 -0800 Subject: [PATCH] Fix small issues (#5896) Summary: The individual commits in this PR should be self-explanatory. All small and _very_ low-priority changes. Pull Request resolved: https://github.com/facebook/rocksdb/pull/5896 Reviewed By: riversand963 Differential Revision: D18065108 Pulled By: mrambacher fbshipit-source-id: 236b1a1d9d21f982cc08aa67027108dde5eaf280 --- include/rocksdb/status.h | 5 ++--- utilities/transactions/transaction_base.h | 3 ++- .../write_batch_with_index/write_batch_with_index_internal.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/rocksdb/status.h b/include/rocksdb/status.h index a60212b89..6f6f09c5c 100644 --- a/include/rocksdb/status.h +++ b/include/rocksdb/status.h @@ -451,12 +451,11 @@ class Status { std::string ToString() const; protected: - // A nullptr state_ (which is always the case for OK) means the message - // is empty, else state_ points to message. - Code code_; SubCode subcode_; Severity sev_; + // A nullptr state_ (which is at least the case for OK) means the extra + // message is empty. const char* state_; #ifdef ROCKSDB_ASSERT_STATUS_CHECKED mutable bool checked_ = false; diff --git a/utilities/transactions/transaction_base.h b/utilities/transactions/transaction_base.h index 3b2ed05df..7febb10ba 100644 --- a/utilities/transactions/transaction_base.h +++ b/utilities/transactions/transaction_base.h @@ -202,7 +202,8 @@ class TransactionBaseImpl : public Transaction { } const Snapshot* GetSnapshot() const override { - return snapshot_ ? snapshot_.get() : nullptr; + // will return nullptr when there is no snapshot + return snapshot_.get(); } virtual void SetSnapshot() override; diff --git a/utilities/write_batch_with_index/write_batch_with_index_internal.h b/utilities/write_batch_with_index/write_batch_with_index_internal.h index 8085f5f50..4a5a5bc18 100644 --- a/utilities/write_batch_with_index/write_batch_with_index_internal.h +++ b/utilities/write_batch_with_index/write_batch_with_index_internal.h @@ -122,7 +122,7 @@ struct WriteBatchIndexEntry { // make the entry just larger than all entries with the search key so // SeekForPrev() will see all the keys with the same key. size_t offset; - uint32_t column_family; // c1olumn family of the entry. + uint32_t column_family; // column family of the entry. size_t key_offset; // offset of the key in write batch's string buffer. size_t key_size; // size of the key. kFlagMinInCf indicates // that this is a dummy look up entry for