use emplace where appropriate per clang-tidy
The clang-tidy warning 'modernize-use-emplace' correctly flags a
few places where emplace should be used over push.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I6ca79285a87d6927e718345dc8dce0387e6b1eda
diff --git a/include/ibm/locks.hpp b/include/ibm/locks.hpp
index 99b9cc3..f0e1612 100644
--- a/include/ibm/locks.hpp
+++ b/include/ibm/locks.hpp
@@ -434,8 +434,7 @@
// Lock table is empty, so we are safe to add the lockrecords
// as there will be no conflict
BMCWEB_LOG_DEBUG << "Lock table is empty, so adding the lockrecords";
- lockTable.emplace(std::pair<uint32_t, LockRequests>(
- thisTransactionId, refLockRequestStructure));
+ lockTable.emplace(thisTransactionId, refLockRequestStructure);
return std::make_pair(false, thisTransactionId);
}
diff --git a/include/ibm/management_console_rest.hpp b/include/ibm/management_console_rest.hpp
index 51f5298..c2bf14a 100644
--- a/include/ibm/management_console_rest.hpp
+++ b/include/ibm/management_console_rest.hpp
@@ -450,10 +450,10 @@
BMCWEB_LOG_DEBUG << "Lockflag : " << lockFlags;
BMCWEB_LOG_DEBUG << "SegmentLength : " << segmentLength;
- segInfo.push_back(std::make_pair(lockFlags, segmentLength));
+ segInfo.emplace_back(std::make_pair(lockFlags, segmentLength));
}
- lockRequestStructure.push_back(make_tuple(
+ lockRequestStructure.emplace_back(make_tuple(
req.session->uniqueId, req.session->clientId.value_or(""), lockType,
resourceId, segInfo));
}