]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2208] Constify and use references in some args
authorMukund Sivaraman <muks@isc.org>
Thu, 25 Oct 2012 00:50:59 +0000 (06:20 +0530)
committerMukund Sivaraman <muks@isc.org>
Thu, 25 Oct 2012 00:50:59 +0000 (06:20 +0530)
src/lib/datasrc/memory/zone_table.cc
src/lib/datasrc/memory/zone_table.h
src/lib/datasrc/memory/zone_table_segment.cc
src/lib/datasrc/memory/zone_table_segment.h

index 7fce633f6d9661f62b536e11af6000759713dedb..c0237f5401c1449c36bffbfc09893fe5ca79c338 100644 (file)
@@ -47,7 +47,7 @@ typedef boost::function<void(ZoneData*)> ZoneDataDeleterType;
 }
 
 ZoneTable*
-ZoneTable::create(util::MemorySegment& mem_sgmt, RRClass zone_class) {
+ZoneTable::create(util::MemorySegment& mem_sgmt, const RRClass& zone_class) {
     SegmentObjectHolder<ZoneTableTree, ZoneDataDeleterType> holder(
         mem_sgmt, ZoneTableTree::create(mem_sgmt),
         boost::bind(deleteZoneData, &mem_sgmt, _1, zone_class));
index 36febe4971f55a63853d57a339fd2b76c6b57853..0976567aaa5d6b2160185dc420f9e38c625f27dc 100644 (file)
@@ -102,7 +102,7 @@ private:
     /// This constructor internally involves resource allocation, and if
     /// it fails, a corresponding standard exception will be thrown.
     /// It never throws an exception otherwise.
-    ZoneTable(dns::RRClass rrclass, ZoneTableTree* zones) :
+    ZoneTable(const dns::RRClass& rrclass, ZoneTableTree* zones) :
         rrclass_(rrclass),
         zones_(zones)
     {}
@@ -121,7 +121,7 @@ public:
     /// \param zone_class The RR class of the zone.  It must be the RR class
     /// that is supposed to be associated to the zone table.
     static ZoneTable* create(util::MemorySegment& mem_sgmt,
-                             dns::RRClass zone_class);
+                             const dns::RRClass& zone_class);
 
     /// \brief Destruct and deallocate \c ZoneTable
     ///
@@ -186,7 +186,7 @@ public:
     FindResult findZone(const isc::dns::Name& name) const;
 
 private:
-    dns::RRClass rrclass_;
+    const dns::RRClass rrclass_;
     boost::interprocess::offset_ptr<ZoneTableTree> zones_;
 };
 }
index 1c7028aeec830abcfe0eff2a3f6432bfc1665b3b..50587c41a5a49457c5f7ced90e58b005f083d001 100644 (file)
@@ -22,7 +22,7 @@ namespace datasrc {
 namespace memory {
 
 ZoneTableSegment*
-ZoneTableSegment::create(const isc::data::Element&, RRClass rrclass) {
+ZoneTableSegment::create(const isc::data::Element&, const RRClass& rrclass) {
     /// FIXME: For now, we always return ZoneTableSegmentLocal. This
     /// should be updated eventually to parse the passed Element
     /// argument and construct a corresponding ZoneTableSegment
index f4b5deda6f4ffd2d821b90cd337b2c19456c9555..64a3fd08b7c9fba571316a30b527590902597cf6 100644 (file)
@@ -98,7 +98,7 @@ public:
     ///               is returned.
     /// \return Returns a ZoneTableSegment object
     static ZoneTableSegment* create(const isc::data::Element& config,
-                                    isc::dns::RRClass rrclass);
+                                    const isc::dns::RRClass& rrclass);
 
     /// \brief Destroy a ZoneTableSegment
     ///