Browse Source

[1604b] Convert arguments to addRRsig to "const Xxx&"

addRRsig does not change its arguments, so there is no reason why
they cannont be declared "const Xxxx&", thereby saving the overhead
of a copy when the method is called.
Stephen Morris 13 years ago
parent
commit
b9aed5e8c4
1 changed files with 13 additions and 13 deletions
  1. 13 13
      src/lib/dns/rrset.h

+ 13 - 13
src/lib/dns/rrset.h

@@ -426,7 +426,7 @@ public:
     /// RRset.  If one does not exist, it is created using the data given.
     /// RRset.  If one does not exist, it is created using the data given.
     ///
     ///
     /// \param rdata Pointer to RRSIG rdata to be added.
     /// \param rdata Pointer to RRSIG rdata to be added.
-    virtual void addRRsig(const rdata::ConstRdataPtr rdata) = 0;
+    virtual void addRRsig(const rdata::ConstRdataPtr& rdata) = 0;
 
 
     /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
     /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
     ///
     ///
@@ -437,7 +437,7 @@ public:
     /// conversion from shared_ptr<X> to shared_ptr<const X>.)
     /// conversion from shared_ptr<X> to shared_ptr<const X>.)
     ///
     ///
     /// \param rdata Pointer to RRSIG rdata to be added.
     /// \param rdata Pointer to RRSIG rdata to be added.
-    virtual void addRRsig(const rdata::RdataPtr rdata) = 0;
+    virtual void addRRsig(const rdata::RdataPtr& rdata) = 0;
 
 
     /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
     /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
     ///
     ///
@@ -457,7 +457,7 @@ public:
     ///
     ///
     /// \param sigs Pointer to a RRSIG RRset containing signatures to be added
     /// \param sigs Pointer to a RRSIG RRset containing signatures to be added
     ///             to the RRSIG RRset associated with this class.
     ///             to the RRSIG RRset associated with this class.
-    virtual void addRRsig(ConstRRsetPtr sigs) = 0;
+    virtual void addRRsig(const ConstRRsetPtr& sigs) = 0;
 
 
     /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
     /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
     ///
     ///
@@ -470,7 +470,7 @@ public:
     ///
     ///
     /// \param sigs Pointer to a RRSIG RRset containing signatures to be added
     /// \param sigs Pointer to a RRSIG RRset containing signatures to be added
     ///             to the RRSIG RRset associated with this class.
     ///             to the RRSIG RRset associated with this class.
-    virtual void addRRsig(RRsetPtr sigs) = 0;
+    virtual void addRRsig(const RRsetPtr& sigs) = 0;
 
 
     /// \brief Clear the RRSIGs for this RRset
     /// \brief Clear the RRSIGs for this RRset
     virtual void removeRRsig() = 0;
     virtual void removeRRsig() = 0;
@@ -756,12 +756,12 @@ public:
         return (RRsetPtr());
         return (RRsetPtr());
     }
     }
 
 
-    virtual void addRRsig(const rdata::ConstRdataPtr) {
+    virtual void addRRsig(const rdata::ConstRdataPtr&) {
         isc_throw(NotImplemented,
         isc_throw(NotImplemented,
                   "BasicRRset does not implement the addRRsig() method");
                   "BasicRRset does not implement the addRRsig() method");
     }
     }
 
 
-    virtual void addRRsig(const rdata::RdataPtr) {
+    virtual void addRRsig(const rdata::RdataPtr&) {
         isc_throw(NotImplemented,
         isc_throw(NotImplemented,
                   "BasicRRset does not implement the addRRsig() method");
                   "BasicRRset does not implement the addRRsig() method");
     }
     }
@@ -771,12 +771,12 @@ public:
                   "BasicRRset does not implement the addRRsig() method");
                   "BasicRRset does not implement the addRRsig() method");
     }
     }
 
 
-    virtual void addRRsig(ConstRRsetPtr) {
+    virtual void addRRsig(const ConstRRsetPtr&) {
         isc_throw(NotImplemented,
         isc_throw(NotImplemented,
                   "BasicRRset does not implement the addRRsig() method");
                   "BasicRRset does not implement the addRRsig() method");
     }
     }
 
 
-    virtual void addRRsig(RRsetPtr) {
+    virtual void addRRsig(const RRsetPtr&) {
         isc_throw(NotImplemented,
         isc_throw(NotImplemented,
                   "BasicRRset does not implement the addRRsig() method");
                   "BasicRRset does not implement the addRRsig() method");
     }
     }
@@ -819,7 +819,7 @@ public:
     }
     }
 
 
     /// \brief Adds an RRSIG RR to this RRset's signatures
     /// \brief Adds an RRSIG RR to this RRset's signatures
-    virtual void addRRsig(const rdata::ConstRdataPtr rdata) {
+    virtual void addRRsig(const rdata::ConstRdataPtr& rdata) {
         if (!rrsig_) {
         if (!rrsig_) {
             rrsig_ = RRsetPtr(new RRset(getName(), getClass(),
             rrsig_ = RRsetPtr(new RRset(getName(), getClass(),
                                         RRType::RRSIG(), getTTL()));
                                         RRType::RRSIG(), getTTL()));
@@ -831,8 +831,8 @@ public:
     // conversion from shared_ptr<X> to shared_ptr<const X>.  Note: we should
     // conversion from shared_ptr<X> to shared_ptr<const X>.  Note: we should
     // revisit the interface of managing RRset signatures, at which point this
     // revisit the interface of managing RRset signatures, at which point this
     // problem may go away.
     // problem may go away.
-    virtual void addRRsig(const rdata::RdataPtr rdata) {
-        addRRsig(static_cast<rdata::ConstRdataPtr>(rdata));
+    virtual void addRRsig(const rdata::RdataPtr& rdata) {
+        addRRsig(static_cast<const rdata::ConstRdataPtr&>(rdata));
     }
     }
 
 
     /// \brief Adds an RRSIG RRset to this RRset
     /// \brief Adds an RRSIG RRset to this RRset
@@ -849,10 +849,10 @@ public:
         }
         }
     }
     }
 
 
-    virtual void addRRsig(ConstRRsetPtr sigs) { addRRsig(*sigs); }
+    virtual void addRRsig(const ConstRRsetPtr& sigs) { addRRsig(*sigs); }
 
 
     // Another workaround for older boost (see above)
     // Another workaround for older boost (see above)
-    virtual void addRRsig(RRsetPtr sigs) { addRRsig(*sigs); }
+    virtual void addRRsig(const RRsetPtr& sigs) { addRRsig(*sigs); }
 
 
     /// \brief Clear the RRSIGs for this RRset
     /// \brief Clear the RRSIGs for this RRset
     virtual void removeRRsig() { rrsig_ = RRsetPtr(); }
     virtual void removeRRsig() { rrsig_ = RRsetPtr(); }