From 7c190070b41c59752c7a81e017b470f82db18a64 Mon Sep 17 00:00:00 2001 From: Aaron Gao Date: Thu, 7 Jul 2016 16:34:41 -0700 Subject: [PATCH] delete unnessary pointer cast in beginInternalTransaction() function Summary: use of dynamic_cast is unnecessary and also introduce difficulty for fbrocksdb support of TransactionDB Test Plan: ./transaction_test Reviewers: sdong, IslamAbdelRahman, andrewkr Reviewed By: andrewkr Subscribers: andrewkr, dhruba, leveldb Differential Revision: https://reviews.facebook.net/D60501 --- utilities/transactions/transaction_db_impl.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/utilities/transactions/transaction_db_impl.cc b/utilities/transactions/transaction_db_impl.cc index ab7d83c84..8e65776de 100644 --- a/utilities/transactions/transaction_db_impl.cc +++ b/utilities/transactions/transaction_db_impl.cc @@ -225,12 +225,8 @@ Transaction* TransactionDBImpl::BeginInternalTransaction( TransactionOptions txn_options; Transaction* txn = BeginTransaction(options, txn_options, nullptr); - assert(dynamic_cast(txn) != nullptr); - auto txn_impl = reinterpret_cast(txn); - // Use default timeout for non-transactional writes - txn_impl->SetLockTimeout(txn_db_options_.default_lock_timeout); - + txn->SetLockTimeout(txn_db_options_.default_lock_timeout); return txn; }