resource: prevents copy elision 17/8517/13
authorGregg Reynolds <reynolds-gregg@norc.org>
Tue, 7 Jun 2016 06:13:38 +0000 (01:13 -0500)
committerMats Wichmann <mats@linux.com>
Sat, 21 Apr 2018 18:46:00 +0000 (18:46 +0000)
eliminate warning: moving a local object in a return statement prevents copy elision

Change-Id: I8a2bc85fb2d8f6e31d04e067a4476970d7d657c6
Signed-off-by: Gregg Reynolds <reynolds-gregg@norc.org>
resource/src/OCRepresentation.cpp

index 83f205d..b3dc5b2 100644 (file)
@@ -863,13 +863,13 @@ namespace OC
     OCRepresentation::AttributeItem OCRepresentation::operator[](const std::string& key)
     {
         OCRepresentation::AttributeItem attr{key, m_values};
-        return std::move(attr);
+        return attr;
     }
 
     const OCRepresentation::AttributeItem OCRepresentation::operator[](const std::string& key) const
     {
         OCRepresentation::AttributeItem attr{key, m_values};
-        return std::move(attr);
+        return attr;
     }
 
     const std::string& OCRepresentation::AttributeItem::attrname() const