[glom] libglom/python_embed/: get_item(): Pass object by const reference.



commit 593d8da6133ec870bcf8e6c9d63dc050daaf2e52
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Feb 11 18:44:58 2010 +0100

    libglom/python_embed/: get_item(): Pass object by const reference.
    
    * glom/libglom/python_embed/py_glom_record.[h|cc]:
    * glom/libglom/python_embed/py_glom_related.[h|cc]:
    * glom/libglom/python_embed/py_glom_relatedrecord.[h|cc:
    getitem(): Pass the object by const &.

 ChangeLog                                          |    9 +++++++++
 glom/libglom/python_embed/py_glom_record.cc        |    2 +-
 glom/libglom/python_embed/py_glom_record.h         |    2 +-
 glom/libglom/python_embed/py_glom_related.cc       |    5 ++---
 glom/libglom/python_embed/py_glom_related.h        |    4 ++--
 glom/libglom/python_embed/py_glom_relatedrecord.cc |    2 +-
 glom/libglom/python_embed/py_glom_relatedrecord.h  |    2 +-
 7 files changed, 17 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8e7a94f..1d70361 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-02-11  Murray Cumming  <murrayc murrayc com>
+
+	libglom/python_embed/: get_item(): Pass object by const reference.
+
+	* glom/libglom/python_embed/py_glom_record.[h|cc]:
+	* glom/libglom/python_embed/py_glom_related.[h|cc]:
+	* glom/libglom/python_embed/py_glom_relatedrecord.[h|cc:
+	getitem(): Pass the object by const &.
+
 1.13.4:
 
 2010-02-11  Murray Cumming  <murrayc murrayc com>
diff --git a/glom/libglom/python_embed/py_glom_record.cc b/glom/libglom/python_embed/py_glom_record.cc
index 10b2460..34f776c 100644
--- a/glom/libglom/python_embed/py_glom_record.cc
+++ b/glom/libglom/python_embed/py_glom_record.cc
@@ -98,7 +98,7 @@ long PyGlomRecord::len() const
   return m_map_field_values.size();
 }
 
-boost::python::object PyGlomRecord::getitem(boost::python::object cppitem)
+boost::python::object PyGlomRecord::getitem(const boost::python::object& cppitem)
 {
   const std::string key = boost::python::extract<std::string>(cppitem);
     
diff --git a/glom/libglom/python_embed/py_glom_record.h b/glom/libglom/python_embed/py_glom_record.h
index f541768..487dd76 100644
--- a/glom/libglom/python_embed/py_glom_record.h
+++ b/glom/libglom/python_embed/py_glom_record.h
@@ -47,7 +47,7 @@ public:
 
   //[] notation:
   long len() const;
-  boost::python::object getitem(boost::python::object item);
+  boost::python::object getitem(const boost::python::object& item);
 
 public:
   //PyObject* m_fields_dict; //Dictionary (map) of field names (string) to field values (Gnome::Gda::Value).
diff --git a/glom/libglom/python_embed/py_glom_related.cc b/glom/libglom/python_embed/py_glom_related.cc
index 24f9258..1676d38 100644
--- a/glom/libglom/python_embed/py_glom_related.cc
+++ b/glom/libglom/python_embed/py_glom_related.cc
@@ -44,7 +44,7 @@ long PyGlomRelated::len() const
   return m_map_relationships.size();
 }
 
-boost::python::object PyGlomRelated::getitem(boost::python::object cppitem)
+boost::python::object PyGlomRelated::getitem(const boost::python::object& cppitem)
 {
   boost::python::extract<std::string> extractor(cppitem);
   if(extractor.check())
@@ -74,7 +74,7 @@ boost::python::object PyGlomRelated::getitem(boost::python::object cppitem)
           //Get the value of the from_key in the parent record.
           sharedptr<Relationship> relationship = iterFind->second;
           const Glib::ustring from_key = relationship->get_from_field();
-          
+
           boost::python::extract<PyGlomRecord*> extractor(m_record);
           if(extractor.check())
           {
@@ -132,4 +132,3 @@ void PyGlomRelated_SetRelationships(PyGlomRelated* self, const PyGlomRelated::ty
 }
 
 } //namespace Glom
-
diff --git a/glom/libglom/python_embed/py_glom_related.h b/glom/libglom/python_embed/py_glom_related.h
index 65f8dde..83e33a6 100644
--- a/glom/libglom/python_embed/py_glom_related.h
+++ b/glom/libglom/python_embed/py_glom_related.h
@@ -38,7 +38,7 @@ public:
 
   //[] notation:
   long len() const;
-  boost::python::object getitem(boost::python::object item);
+  boost::python::object getitem(const boost::python::object& item);
 
   friend class PyGlomRecord;
 
@@ -48,7 +48,7 @@ public:
 //TODO: protected:
   boost::python::object m_record; //Actually PyGlomRecord. A reference to the parent record.
 
- 
+
   type_map_relationships m_map_relationships;
 
   type_map_relatedrecords m_map_relatedrecords;
diff --git a/glom/libglom/python_embed/py_glom_relatedrecord.cc b/glom/libglom/python_embed/py_glom_relatedrecord.cc
index 4f2c9da..51e7b81 100644
--- a/glom/libglom/python_embed/py_glom_relatedrecord.cc
+++ b/glom/libglom/python_embed/py_glom_relatedrecord.cc
@@ -51,7 +51,7 @@ long PyGlomRelatedRecord::len() const
   return m_map_field_values.size();
 }
 
-boost::python::object PyGlomRelatedRecord::getitem(boost::python::object cppitem)
+boost::python::object PyGlomRelatedRecord::getitem(const boost::python::object& cppitem)
 {
   const std::string field_name = boost::python::extract<std::string>(cppitem);
  
diff --git a/glom/libglom/python_embed/py_glom_relatedrecord.h b/glom/libglom/python_embed/py_glom_relatedrecord.h
index caee847..c4dad58 100644
--- a/glom/libglom/python_embed/py_glom_relatedrecord.h
+++ b/glom/libglom/python_embed/py_glom_relatedrecord.h
@@ -45,7 +45,7 @@ public:
 
   //[] notation:
   long len() const;
-  boost::python::object getitem(boost::python::object item);
+  boost::python::object getitem(const boost::python::object& item);
 
 //TODO: protected:
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]