Skip to content

Commit 5272305

Browse files
pallasfacebook-github-bot
authored andcommitted
Fix FilterBench when RTTI=0 (facebook#6732)
Summary: The dynamic_cast in the filter benchmark causes release mode to fail due to no-rtti. Replace with static_cast_with_check. Signed-off-by: Derrick Pallas <[email protected]> Addition by peterd: Remove unnecessary 2nd template arg on all static_cast_with_check Pull Request resolved: facebook#6732 Reviewed By: ltamasi Differential Revision: D21304260 Pulled By: pdillinger fbshipit-source-id: 6e8eb437c4ca5a16dbbfa4053d67c4ad55f1608c
1 parent 8086e5e commit 5272305

26 files changed

+58
-81
lines changed

db/convenience.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace ROCKSDB_NAMESPACE {
1515

1616
void CancelAllBackgroundWork(DB* db, bool wait) {
17-
(static_cast_with_check<DBImpl, DB>(db->GetRootDB()))
17+
(static_cast_with_check<DBImpl>(db->GetRootDB()))
1818
->CancelAllBackgroundWork(wait);
1919
}
2020

@@ -28,7 +28,7 @@ Status DeleteFilesInRange(DB* db, ColumnFamilyHandle* column_family,
2828
Status DeleteFilesInRanges(DB* db, ColumnFamilyHandle* column_family,
2929
const RangePtr* ranges, size_t n,
3030
bool include_end) {
31-
return (static_cast_with_check<DBImpl, DB>(db->GetRootDB()))
31+
return (static_cast_with_check<DBImpl>(db->GetRootDB()))
3232
->DeleteFilesInRanges(column_family, ranges, n, include_end);
3333
}
3434

db/db_impl/db_impl.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -870,9 +870,7 @@ void DBImpl::DumpStats() {
870870
Status DBImpl::TablesRangeTombstoneSummary(ColumnFamilyHandle* column_family,
871871
int max_entries_to_print,
872872
std::string* out_str) {
873-
auto* cfh =
874-
static_cast_with_check<ColumnFamilyHandleImpl, ColumnFamilyHandle>(
875-
column_family);
873+
auto* cfh = static_cast_with_check<ColumnFamilyHandleImpl>(column_family);
876874
ColumnFamilyData* cfd = cfh->cfd();
877875

878876
SuperVersion* super_version = cfd->GetReferencedSuperVersion(this);

db/db_impl/db_impl_compaction_flush.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2143,8 +2143,7 @@ void DBImpl::BGWorkFlush(void* arg) {
21432143

21442144
IOSTATS_SET_THREAD_POOL_ID(fta.thread_pri_);
21452145
TEST_SYNC_POINT("DBImpl::BGWorkFlush");
2146-
static_cast_with_check<DBImpl, DB>(fta.db_)->BackgroundCallFlush(
2147-
fta.thread_pri_);
2146+
static_cast_with_check<DBImpl>(fta.db_)->BackgroundCallFlush(fta.thread_pri_);
21482147
TEST_SYNC_POINT("DBImpl::BGWorkFlush:done");
21492148
}
21502149

@@ -2155,7 +2154,7 @@ void DBImpl::BGWorkCompaction(void* arg) {
21552154
TEST_SYNC_POINT("DBImpl::BGWorkCompaction");
21562155
auto prepicked_compaction =
21572156
static_cast<PrepickedCompaction*>(ca.prepicked_compaction);
2158-
static_cast_with_check<DBImpl, DB>(ca.db)->BackgroundCallCompaction(
2157+
static_cast_with_check<DBImpl>(ca.db)->BackgroundCallCompaction(
21592158
prepicked_compaction, Env::Priority::LOW);
21602159
delete prepicked_compaction;
21612160
}

db/table_cache.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,7 @@ void TableCache::CreateRowCacheKeyPrefix(const ReadOptions& options,
314314
// Maybe we can include the whole file ifsnapshot == fd.largest_seqno.
315315
if (options.snapshot != nullptr &&
316316
(get_context->has_callback() ||
317-
static_cast_with_check<const SnapshotImpl, const Snapshot>(
318-
options.snapshot)
317+
static_cast_with_check<const SnapshotImpl>(options.snapshot)
319318
->GetSequenceNumber() <= fd.largest_seqno)) {
320319
// We should consider to use options.snapshot->GetSequenceNumber()
321320
// instead of GetInternalKeySeqno(k), which will make the code

db/wal_manager.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,8 @@ Status WalManager::GetSortedWalsOfType(const std::string& path,
334334
std::sort(
335335
log_files.begin(), log_files.end(),
336336
[](const std::unique_ptr<LogFile>& a, const std::unique_ptr<LogFile>& b) {
337-
LogFileImpl* a_impl =
338-
static_cast_with_check<LogFileImpl, LogFile>(a.get());
339-
LogFileImpl* b_impl =
340-
static_cast_with_check<LogFileImpl, LogFile>(b.get());
337+
LogFileImpl* a_impl = static_cast_with_check<LogFileImpl>(a.get());
338+
LogFileImpl* b_impl = static_cast_with_check<LogFileImpl>(b.get());
341339
return *a_impl < *b_impl;
342340
});
343341
return status;

db/write_batch.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,7 @@ class MemTableInserter : public WriteBatch::Handler {
12811281
ignore_missing_column_families_(ignore_missing_column_families),
12821282
recovering_log_number_(recovering_log_number),
12831283
log_number_ref_(0),
1284-
db_(static_cast_with_check<DBImpl, DB>(db)),
1284+
db_(static_cast_with_check<DBImpl>(db)),
12851285
concurrent_memtable_writes_(concurrent_memtable_writes),
12861286
post_info_created_(false),
12871287
has_valid_writes_(has_valid_writes),

env/mock_env.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,8 +701,7 @@ Status MockEnv::LockFile(const std::string& fname, FileLock** flock) {
701701
}
702702

703703
Status MockEnv::UnlockFile(FileLock* flock) {
704-
std::string fn =
705-
static_cast_with_check<MockEnvFileLock, FileLock>(flock)->FileName();
704+
std::string fn = static_cast_with_check<MockEnvFileLock>(flock)->FileName();
706705
{
707706
MutexLock lock(&mutex_);
708707
if (file_map_.find(fn) != file_map_.end()) {

monitoring/histogram.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ void HistogramImpl::Add(uint64_t value) {
251251

252252
void HistogramImpl::Merge(const Histogram& other) {
253253
if (strcmp(Name(), other.Name()) == 0) {
254-
Merge(
255-
*static_cast_with_check<const HistogramImpl, const Histogram>(&other));
254+
Merge(*static_cast_with_check<const HistogramImpl>(&other));
256255
}
257256
}
258257

monitoring/histogram_windowing.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ void HistogramWindowingImpl::Add(uint64_t value){
6565

6666
void HistogramWindowingImpl::Merge(const Histogram& other) {
6767
if (strcmp(Name(), other.Name()) == 0) {
68-
Merge(
69-
*static_cast_with_check<const HistogramWindowingImpl, const Histogram>(
70-
&other));
68+
Merge(*static_cast_with_check<const HistogramWindowingImpl>(&other));
7169
}
7270
}
7371

options/cf_options.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ std::unordered_map<std::string, OptionTypeInfo>
413413
reinterpret_cast<std::shared_ptr<TableFactory>*>(addr);
414414
BlockBasedTableOptions table_opts, base_opts;
415415
BlockBasedTableFactory* block_based_table_factory =
416-
static_cast_with_check<BlockBasedTableFactory, TableFactory>(
416+
static_cast_with_check<BlockBasedTableFactory>(
417417
old_table_factory->get());
418418
if (block_based_table_factory != nullptr) {
419419
base_opts = block_based_table_factory->table_options();
@@ -437,7 +437,7 @@ std::unordered_map<std::string, OptionTypeInfo>
437437
reinterpret_cast<std::shared_ptr<TableFactory>*>(addr);
438438
PlainTableOptions table_opts, base_opts;
439439
PlainTableFactory* plain_table_factory =
440-
static_cast_with_check<PlainTableFactory, TableFactory>(
440+
static_cast_with_check<PlainTableFactory>(
441441
old_table_factory->get());
442442
if (plain_table_factory != nullptr) {
443443
base_opts = plain_table_factory->table_options();

tools/db_bench_tool.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3287,10 +3287,9 @@ class Benchmark {
32873287
fprintf(stdout, "STATISTICS:\n%s\n", dbstats->ToString().c_str());
32883288
}
32893289
if (FLAGS_simcache_size >= 0) {
3290-
fprintf(stdout, "SIMULATOR CACHE STATISTICS:\n%s\n",
3291-
static_cast_with_check<SimCache, Cache>(cache_.get())
3292-
->ToString()
3293-
.c_str());
3290+
fprintf(
3291+
stdout, "SIMULATOR CACHE STATISTICS:\n%s\n",
3292+
static_cast_with_check<SimCache>(cache_.get())->ToString().c_str());
32943293
}
32953294

32963295
#ifndef ROCKSDB_LITE

tools/ldb_cmd.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,7 @@ void DBDumperCommand::DoDumpCommand() {
17481748
if (max_keys == 0)
17491749
break;
17501750
if (is_db_ttl_) {
1751-
TtlIterator* it_ttl = static_cast_with_check<TtlIterator, Iterator>(iter);
1751+
TtlIterator* it_ttl = static_cast_with_check<TtlIterator>(iter);
17521752
rawtime = it_ttl->ttl_timestamp();
17531753
if (rawtime < ttl_start || rawtime >= ttl_end) {
17541754
continue;
@@ -2575,7 +2575,7 @@ void ScanCommand::DoCommand() {
25752575
it->Valid() && (!end_key_specified_ || it->key().ToString() < end_key_);
25762576
it->Next()) {
25772577
if (is_db_ttl_) {
2578-
TtlIterator* it_ttl = static_cast_with_check<TtlIterator, Iterator>(it);
2578+
TtlIterator* it_ttl = static_cast_with_check<TtlIterator>(it);
25792579
int rawtime = it_ttl->ttl_timestamp();
25802580
if (rawtime < ttl_start || rawtime >= ttl_end) {
25812581
continue;
@@ -3416,7 +3416,7 @@ void ListFileRangeDeletesCommand::DoCommand() {
34163416
return;
34173417
}
34183418

3419-
DBImpl* db_impl = static_cast_with_check<DBImpl, DB>(db_->GetRootDB());
3419+
DBImpl* db_impl = static_cast_with_check<DBImpl>(db_->GetRootDB());
34203420

34213421
std::string out_str;
34223422

util/filter_bench.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ int main() {
2323
#include "table/block_based/full_filter_block.h"
2424
#include "table/block_based/mock_block_based_table.h"
2525
#include "table/plain/plain_table_bloom.h"
26+
#include "util/cast_util.h"
2627
#include "util/gflags_compat.h"
2728
#include "util/hash.h"
2829
#include "util/random.h"
@@ -131,6 +132,7 @@ using ROCKSDB_NAMESPACE::ParsedFullFilterBlock;
131132
using ROCKSDB_NAMESPACE::PlainTableBloomV1;
132133
using ROCKSDB_NAMESPACE::Random32;
133134
using ROCKSDB_NAMESPACE::Slice;
135+
using ROCKSDB_NAMESPACE::static_cast_with_check;
134136
using ROCKSDB_NAMESPACE::StderrLogger;
135137
using ROCKSDB_NAMESPACE::mock::MockBlockBasedTableTester;
136138

@@ -378,7 +380,8 @@ void FilterBench::Go() {
378380
info.filter_ = info.plain_table_bloom_->GetRawData();
379381
} else {
380382
if (!builder) {
381-
builder.reset(&dynamic_cast<BuiltinFilterBitsBuilder &>(*GetBuilder()));
383+
builder.reset(
384+
static_cast_with_check<BuiltinFilterBitsBuilder>(GetBuilder()));
382385
}
383386
for (uint32_t i = 0; i < keys_to_add; ++i) {
384387
builder->AddKey(kms_[0].Get(filter_id, i));

utilities/blob_db/blob_db_impl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ Status BlobDBImpl::Open(std::vector<ColumnFamilyHandle*>* handles) {
209209
if (!s.ok()) {
210210
return s;
211211
}
212-
db_impl_ = static_cast_with_check<DBImpl, DB>(db_->GetRootDB());
212+
db_impl_ = static_cast_with_check<DBImpl>(db_->GetRootDB());
213213

214214
// Initialize SST file <-> oldest blob file mapping if garbage collection
215215
// is enabled.

utilities/transactions/optimistic_transaction.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Status OptimisticTransaction::CommitWithSerialValidate() {
7676
// check whether this transaction is safe to be committed.
7777
OptimisticTransactionCallback callback(this);
7878

79-
DBImpl* db_impl = static_cast_with_check<DBImpl, DB>(db_->GetRootDB());
79+
DBImpl* db_impl = static_cast_with_check<DBImpl>(db_->GetRootDB());
8080

8181
Status s = db_impl->WriteWithCallback(
8282
write_options_, GetWriteBatch()->GetWriteBatch(), &callback);
@@ -92,7 +92,7 @@ Status OptimisticTransaction::CommitWithParallelValidate() {
9292
auto txn_db_impl = static_cast_with_check<OptimisticTransactionDBImpl,
9393
OptimisticTransactionDB>(txn_db_);
9494
assert(txn_db_impl);
95-
DBImpl* db_impl = static_cast_with_check<DBImpl, DB>(db_->GetRootDB());
95+
DBImpl* db_impl = static_cast_with_check<DBImpl>(db_->GetRootDB());
9696
assert(db_impl);
9797
const size_t space = txn_db_impl->GetLockBucketsSize();
9898
std::set<size_t> lk_idxes;
@@ -168,7 +168,7 @@ Status OptimisticTransaction::TryLock(ColumnFamilyHandle* column_family,
168168
Status OptimisticTransaction::CheckTransactionForConflicts(DB* db) {
169169
Status result;
170170

171-
auto db_impl = static_cast_with_check<DBImpl, DB>(db);
171+
auto db_impl = static_cast_with_check<DBImpl>(db);
172172

173173
// Since we are on the write thread and do not want to block other writers,
174174
// we will do a cache-only conflict check. This can result in TryAgain

utilities/transactions/pessimistic_transaction.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ PessimisticTransaction::PessimisticTransaction(
4848
deadlock_detect_(false),
4949
deadlock_detect_depth_(0),
5050
skip_concurrency_control_(false) {
51-
txn_db_impl_ =
52-
static_cast_with_check<PessimisticTransactionDB, TransactionDB>(txn_db);
53-
db_impl_ = static_cast_with_check<DBImpl, DB>(db_);
51+
txn_db_impl_ = static_cast_with_check<PessimisticTransactionDB>(txn_db);
52+
db_impl_ = static_cast_with_check<DBImpl>(db_);
5453
if (init) {
5554
Initialize(txn_options);
5655
}

utilities/transactions/pessimistic_transaction_db.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace ROCKSDB_NAMESPACE {
2929
PessimisticTransactionDB::PessimisticTransactionDB(
3030
DB* db, const TransactionDBOptions& txn_db_options)
3131
: TransactionDB(db),
32-
db_impl_(static_cast_with_check<DBImpl, DB>(db)),
32+
db_impl_(static_cast_with_check<DBImpl>(db)),
3333
txn_db_options_(txn_db_options),
3434
lock_mgr_(this, txn_db_options_.num_stripes, txn_db_options.max_num_locks,
3535
txn_db_options_.max_num_deadlocks,
@@ -60,7 +60,7 @@ PessimisticTransactionDB::PessimisticTransactionDB(
6060
PessimisticTransactionDB::PessimisticTransactionDB(
6161
StackableDB* db, const TransactionDBOptions& txn_db_options)
6262
: TransactionDB(db),
63-
db_impl_(static_cast_with_check<DBImpl, DB>(db->GetRootDB())),
63+
db_impl_(static_cast_with_check<DBImpl>(db->GetRootDB())),
6464
txn_db_options_(txn_db_options),
6565
lock_mgr_(this, txn_db_options_.num_stripes, txn_db_options.max_num_locks,
6666
txn_db_options_.max_num_deadlocks,
@@ -113,7 +113,7 @@ Status PessimisticTransactionDB::Initialize(
113113
Status s = EnableAutoCompaction(compaction_enabled_cf_handles);
114114

115115
// create 'real' transactions from recovered shell transactions
116-
auto dbimpl = static_cast_with_check<DBImpl, DB>(GetRootDB());
116+
auto dbimpl = static_cast_with_check<DBImpl>(GetRootDB());
117117
assert(dbimpl != nullptr);
118118
auto rtrxs = dbimpl->recovered_transactions();
119119

@@ -569,8 +569,7 @@ bool PessimisticTransactionDB::TryStealingExpiredTransactionLocks(
569569
void PessimisticTransactionDB::ReinitializeTransaction(
570570
Transaction* txn, const WriteOptions& write_options,
571571
const TransactionOptions& txn_options) {
572-
auto txn_impl =
573-
static_cast_with_check<PessimisticTransaction, Transaction>(txn);
572+
auto txn_impl = static_cast_with_check<PessimisticTransaction>(txn);
574573

575574
txn_impl->Reinitialize(this, write_options, txn_options);
576575
}

utilities/transactions/pessimistic_transaction_db.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ class PessimisticTransactionDB : public TransactionDB {
7575
Transaction* txn = BeginInternalTransaction(opts);
7676
txn->DisableIndexing();
7777

78-
auto txn_impl =
79-
static_cast_with_check<PessimisticTransaction, Transaction>(txn);
78+
auto txn_impl = static_cast_with_check<PessimisticTransaction>(txn);
8079

8180
// Since commitBatch sorts the keys before locking, concurrent Write()
8281
// operations will not cause a deadlock.

utilities/transactions/transaction_base.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace ROCKSDB_NAMESPACE {
2222
TransactionBaseImpl::TransactionBaseImpl(DB* db,
2323
const WriteOptions& write_options)
2424
: db_(db),
25-
dbimpl_(static_cast_with_check<DBImpl, DB>(db)),
25+
dbimpl_(static_cast_with_check<DBImpl>(db)),
2626
write_options_(write_options),
2727
cmp_(GetColumnFamilyUserComparator(db->DefaultColumnFamily())),
2828
start_time_(db_->GetEnv()->NowMicros()),

utilities/transactions/transaction_lock_mgr.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ TransactionLockMgr::TransactionLockMgr(
166166
dlock_buffer_(max_num_deadlocks),
167167
mutex_factory_(mutex_factory) {
168168
assert(txn_db);
169-
txn_db_impl_ =
170-
static_cast_with_check<PessimisticTransactionDB, TransactionDB>(txn_db);
169+
txn_db_impl_ = static_cast_with_check<PessimisticTransactionDB>(txn_db);
171170
}
172171

173172
TransactionLockMgr::~TransactionLockMgr() {}

utilities/transactions/write_prepared_txn.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,7 @@ Status WritePreparedTxn::ValidateSnapshot(ColumnFamilyHandle* column_family,
430430
assert(snapshot_);
431431

432432
SequenceNumber min_uncommitted =
433-
static_cast_with_check<const SnapshotImpl, const Snapshot>(
434-
snapshot_.get())
433+
static_cast_with_check<const SnapshotImpl>(snapshot_.get())
435434
->min_uncommitted_;
436435
SequenceNumber snap_seq = snapshot_->GetSequenceNumber();
437436
// tracked_at_seq is either max or the last snapshot with which this key was

utilities/transactions/write_prepared_txn_db.cc

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace ROCKSDB_NAMESPACE {
3030
Status WritePreparedTxnDB::Initialize(
3131
const std::vector<size_t>& compaction_enabled_cf_indices,
3232
const std::vector<ColumnFamilyHandle*>& handles) {
33-
auto dbimpl = static_cast_with_check<DBImpl, DB>(GetRootDB());
33+
auto dbimpl = static_cast_with_check<DBImpl>(GetRootDB());
3434
assert(dbimpl != nullptr);
3535
auto rtxns = dbimpl->recovered_transactions();
3636
std::map<SequenceNumber, SequenceNumber> ordered_seq_cnt;
@@ -328,17 +328,15 @@ Iterator* WritePreparedTxnDB::NewIterator(const ReadOptions& options,
328328
if (options.snapshot != nullptr) {
329329
snapshot_seq = options.snapshot->GetSequenceNumber();
330330
min_uncommitted =
331-
static_cast_with_check<const SnapshotImpl, const Snapshot>(
332-
options.snapshot)
331+
static_cast_with_check<const SnapshotImpl>(options.snapshot)
333332
->min_uncommitted_;
334333
} else {
335334
auto* snapshot = GetSnapshot();
336335
// We take a snapshot to make sure that the related data in the commit map
337336
// are not deleted.
338337
snapshot_seq = snapshot->GetSequenceNumber();
339338
min_uncommitted =
340-
static_cast_with_check<const SnapshotImpl, const Snapshot>(snapshot)
341-
->min_uncommitted_;
339+
static_cast_with_check<const SnapshotImpl>(snapshot)->min_uncommitted_;
342340
own_snapshot = std::make_shared<ManagedSnapshot>(db_impl_, snapshot);
343341
}
344342
assert(snapshot_seq != kMaxSequenceNumber);
@@ -363,18 +361,17 @@ Status WritePreparedTxnDB::NewIterators(
363361
SequenceNumber min_uncommitted = 0;
364362
if (options.snapshot != nullptr) {
365363
snapshot_seq = options.snapshot->GetSequenceNumber();
366-
min_uncommitted = static_cast_with_check<const SnapshotImpl, const Snapshot>(
367-
options.snapshot)
368-
->min_uncommitted_;
364+
min_uncommitted =
365+
static_cast_with_check<const SnapshotImpl>(options.snapshot)
366+
->min_uncommitted_;
369367
} else {
370368
auto* snapshot = GetSnapshot();
371369
// We take a snapshot to make sure that the related data in the commit map
372370
// are not deleted.
373371
snapshot_seq = snapshot->GetSequenceNumber();
374372
own_snapshot = std::make_shared<ManagedSnapshot>(db_impl_, snapshot);
375373
min_uncommitted =
376-
static_cast_with_check<const SnapshotImpl, const Snapshot>(snapshot)
377-
->min_uncommitted_;
374+
static_cast_with_check<const SnapshotImpl>(snapshot)->min_uncommitted_;
378375
}
379376
iterators->clear();
380377
iterators->reserve(column_families.size());

utilities/transactions/write_prepared_txn_db.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,10 +1078,9 @@ SnapshotBackup WritePreparedTxnDB::AssignMinMaxSeqs(const Snapshot* snapshot,
10781078
SequenceNumber* min,
10791079
SequenceNumber* max) {
10801080
if (snapshot != nullptr) {
1081-
*min = static_cast_with_check<const SnapshotImpl, const Snapshot>(snapshot)
1082-
->min_uncommitted_;
1083-
*max = static_cast_with_check<const SnapshotImpl, const Snapshot>(snapshot)
1084-
->number_;
1081+
*min =
1082+
static_cast_with_check<const SnapshotImpl>(snapshot)->min_uncommitted_;
1083+
*max = static_cast_with_check<const SnapshotImpl>(snapshot)->number_;
10851084
return kBackedByDBSnapshot;
10861085
} else {
10871086
*min = SmallestUnCommittedSeq();

0 commit comments

Comments
 (0)