]> WPIA git - cassiopeia.git/commitdiff
chg: introduce std::make_shared where appropriate
authorFlorian Weber <oss@florianjw.de>
Sat, 6 Jun 2015 02:12:17 +0000 (04:12 +0200)
committerBenny Baumann <BenBE@geshi.org>
Sun, 7 Jun 2015 11:37:19 +0000 (13:37 +0200)
src/db/mysql.cpp

index 1883488eb373cdaf11bdc47a6c5be867f0da5f04..0f4df7022d8b044c61ef7877afd931b7552abb8a 100644 (file)
@@ -121,7 +121,7 @@ std::shared_ptr<Job> MySQLJobProvider::fetchJob() {
         return std::shared_ptr<Job>();
     }
 
-    std::shared_ptr<Job> job( new Job() );
+    auto job = std::make_shared<Job>();
 
     unsigned long* l = mysql_fetch_lengths( res.get() );
 
@@ -187,7 +187,7 @@ void MySQLJobProvider::failJob( std::shared_ptr<Job> job ) {
 }
 
 std::shared_ptr<TBSCertificate> MySQLJobProvider::fetchTBSCert( std::shared_ptr<Job> job ) {
-    std::shared_ptr<TBSCertificate> cert = std::shared_ptr<TBSCertificate>( new TBSCertificate() );
+    auto cert = std::make_shared<TBSCertificate>();
     std::string q = "SELECT md, profile, csr_name, csr_type, keyname FROM certs INNER JOIN profiles ON profiles.id = certs.profile WHERE certs.id='" + this->escape_string( job->target ) + "'";
 
     int err = 0;