include/cppunit/tools/XmlElement.h |    8 ++++----
 src/cppunit/XmlElement.cpp         |    8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 2b72f2b3ef94452ae649fc6a44bec049f1acb173
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sat Jan 6 19:37:42 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sat Jan 6 20:42:38 2024 +0100

    cid#1546421 COPY_INSTEAD_OF_MOVE
    
    Change-Id: I33787047d5125252204aac78ed876bc102a1ec11
    Reviewed-on: https://gerrit.libreoffice.org/c/cppunit/+/161722
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/include/cppunit/tools/XmlElement.h 
b/include/cppunit/tools/XmlElement.h
index 3478a35..d033aa2 100644
--- a/include/cppunit/tools/XmlElement.h
+++ b/include/cppunit/tools/XmlElement.h
@@ -79,14 +79,14 @@ public:
    * \param attributeName Name of the attribute. Must not be an empty.
    * \param value Value of the attribute.
    */
-  void addAttribute( std::string attributeName,
-                     std::string value );
+  void addAttribute( const std::string& attributeName,
+                     const std::string& value );
 
   /*! rief Adds an attribute with the specified numeric value.
    * \param attributeName Name of the attribute. Must not be empty.
    * \param numericValue Numeric value of the attribute.
    */
-  void addAttribute( std::string attributeName,
+  void addAttribute( const std::string& attributeName,
                      int numericValue );
 
   /*! rief Adds a child element to the element.
@@ -125,7 +125,7 @@ private:
   typedef std::pair<std::string,std::string> Attribute;
 
   std::string attributesAsString() const;
-  std::string escape( std::string value ) const;
+  std::string escape( const std::string& value ) const;
 
 private:
   std::string m_name;
diff --git a/src/cppunit/XmlElement.cpp b/src/cppunit/XmlElement.cpp
index be02385..3a59814 100644
--- a/src/cppunit/XmlElement.cpp
+++ b/src/cppunit/XmlElement.cpp
@@ -74,15 +74,15 @@ XmlElement::setContent( int numericContent )
 
 
 void 
-XmlElement::addAttribute( std::string attributeName,
-                          std::string value  )
+XmlElement::addAttribute( const std::string& attributeName,
+                          const std::string& value  )
 {
   m_attributes.push_back( Attribute( attributeName, value ) );
 }
 
 
 void 
-XmlElement::addAttribute( std::string attributeName,
+XmlElement::addAttribute( const std::string& attributeName,
                           int numericValue )
 {
   addAttribute( attributeName, StringTools::toString( numericValue ) );
@@ -194,7 +194,7 @@ XmlElement::attributesAsString() const
 
 
 std::string 
-XmlElement::escape( std::string value ) const
+XmlElement::escape( const std::string& value ) const
 {
   std::string escaped;
   for ( unsigned int index =0; index < value.length(); ++index )

Reply via email to