src: Removing unnecessary use of cref() in concert with make_shared
This commit also replaces all usages of shared_ptr<T>(new T) with
make_shared<T> in Face class implementation.
Change-Id: I44971c44eb7f2c25ecfe00e185309973c9cbd246
Refs: #1592
diff --git a/src/security/conf/checker.hpp b/src/security/conf/checker.hpp
index 05eb8c1..1ebcf0d 100644
--- a/src/security/conf/checker.hpp
+++ b/src/security/conf/checker.hpp
@@ -380,7 +380,7 @@
if (propertyIt != configSection.end())
throw Error("Expect the end of checker!");
- return make_shared<CustomizedChecker>(getSigType(sigType), cref(keyLocatorChecker));
+ return make_shared<CustomizedChecker>(getSigType(sigType), keyLocatorChecker);
}
static shared_ptr<Checker>
diff --git a/src/security/conf/filter.hpp b/src/security/conf/filter.hpp
index 8fa91b8..8caa5cc 100644
--- a/src/security/conf/filter.hpp
+++ b/src/security/conf/filter.hpp
@@ -199,8 +199,7 @@
if (propertyIt != configSection.end())
throw Error("Expect the end of filter!");
- return make_shared<RelationNameFilter>(cref(name),
- cref(relation));
+ return make_shared<RelationNameFilter>(name, relation);
}
else if (boost::iequals(propertyIt->first, "regex"))
{
diff --git a/src/security/sec-public-info-memory.cpp b/src/security/sec-public-info-memory.cpp
index c9efc2f..be0a1e7 100644
--- a/src/security/sec-public-info-memory.cpp
+++ b/src/security/sec-public-info-memory.cpp
@@ -61,7 +61,7 @@
addIdentity(identityName);
- m_keyStore[keyName.toUri()] = make_shared<KeyRecord>(keyType, cref(publicKey));
+ m_keyStore[keyName.toUri()] = make_shared<KeyRecord>(keyType, publicKey);
}
shared_ptr<PublicKey>
diff --git a/src/security/validator-config.hpp b/src/security/validator-config.hpp
index 9dc69e3..121d7e1 100644
--- a/src/security/validator-config.hpp
+++ b/src/security/validator-config.hpp
@@ -209,7 +209,7 @@
Interest certInterest(keyLocatorName);
shared_ptr<ValidationRequest> nextStep =
- make_shared<ValidationRequest>(cref(certInterest),
+ make_shared<ValidationRequest>(certInterest,
onCertValidated,
onCertValidationFailed,
1, nSteps + 1);
@@ -229,7 +229,7 @@
const OnFailed& onValidationFailed)
{
shared_ptr<IdentityCertificate> certificate =
- make_shared<IdentityCertificate>(cref(*signCertificate));
+ make_shared<IdentityCertificate>(*signCertificate);
if (!certificate->isTooLate() && !certificate->isTooEarly())
{
diff --git a/src/security/validator-regex.cpp b/src/security/validator-regex.cpp
index b4fd1b8..4c74e79 100644
--- a/src/security/validator-regex.cpp
+++ b/src/security/validator-regex.cpp
@@ -46,7 +46,7 @@
const OnDataValidationFailed& onValidationFailed)
{
shared_ptr<IdentityCertificate> certificate =
- make_shared<IdentityCertificate>(cref(*signCertificate));
+ make_shared<IdentityCertificate>(*signCertificate);
if (!certificate->isTooLate() && !certificate->isTooEarly())
{
@@ -137,7 +137,7 @@
Interest interest(sig.getKeyLocator().getName());
shared_ptr<ValidationRequest> nextStep =
- make_shared<ValidationRequest>(cref(interest),
+ make_shared<ValidationRequest>(interest,
onKeyValidated,
onKeyValidationFailed,
3,