Apply suggestions from code review

Use emplace_back instead of push_back

Co-Authored-By: Jingyu Zhou <jingyuzhou@gmail.com>
This commit is contained in:
A.J. Beamon 2019-07-02 11:09:46 -07:00 committed by GitHub
parent aa1bc0087e
commit 7e5b5a0536
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -597,7 +597,8 @@ Version MultiVersionTransaction::getCommittedVersion() {
void MultiVersionTransaction::setOption(FDBTransactionOptions::Option option, Optional<StringRef> value) {
if(MultiVersionApi::apiVersionAtLeast(610) && FDBTransactionOptions::optionInfo[option].persistent) {
persistentOptions.push_back(std::make_pair(option, value.castTo<Standalone<StringRef>>()));
persistentOptions.emplace_back(option, value.castTo<Standalone<StringRef>>());
}
auto tr = getTransaction();
if(tr.transaction) {

View File

@ -1762,7 +1762,8 @@ void ReadYourWritesTransaction::setOption( FDBTransactionOptions::Option option,
setOptionImpl(option, value);
if(FDBTransactionOptions::optionInfo[option].persistent) {
persistentOptions.push_back(std::make_pair(option, value.castTo<Standalone<StringRef>>()));
persistentOptions.emplace_back(option, value.castTo<Standalone<StringRef>>());
}
}