Fix minor coverity issues 80/300080/2
authorEunki Hong <eunkiki.hong@samsung.com>
Mon, 16 Oct 2023 11:19:10 +0000 (20:19 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Mon, 16 Oct 2023 14:26:22 +0000 (23:26 +0900)
1. Remove std::string copy
2. Remove Property::Array copy

Change-Id: I9b45c0ff87588a6f79d8ae4a109909c7c016dbdf
Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
dali-toolkit/internal/controls/buttons/toggle-button-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/controls/scene3d-view/gltf-loader.cpp
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp
dali-toolkit/internal/controls/tooltip/tooltip.cpp

index b124d22..d85f8fd 100644 (file)
@@ -176,8 +176,7 @@ Property::Value ToggleButton::GetProperty(BaseObject* object, Property::Index pr
     {
       case Toolkit::ToggleButton::Property::STATE_VISUALS:
       {
-        Property::Array array = toggleButtonImpl.GetToggleStates();
-        value                 = Property::Value(array);
+        value = toggleButtonImpl.GetToggleStates();
         break;
       }
       case Toolkit::ToggleButton::Property::TOOLTIPS:
index 548a4c9..a837b77 100644 (file)
@@ -2116,7 +2116,7 @@ Dali::Property Control::Impl::GetVisualProperty(Dali::Property::Index index, Dal
   if(visual)
   {
     Internal::Visual::Base& visualImpl = Toolkit::GetImplementation(visual);
-    return visualImpl.GetPropertyObject(visualPropertyKey);
+    return visualImpl.GetPropertyObject(std::move(visualPropertyKey));
   }
 
   Handle handle;
index c25e3d0..8bcc978 100644 (file)
@@ -396,10 +396,10 @@ void SetVertexBufferData(MeshInfo& meshInfo, std::string path, std::vector<Acces
   if(accessorIdx >= 0)
   {
     Dali::Vector<Vector3> bufferData;
-    LoadDataFromAccessor(accessorIdx, bufferData, path, accessorArray, bufferViewArray, bufferArray);
+    LoadDataFromAccessor(accessorIdx, bufferData, std::move(path), accessorArray, bufferViewArray, bufferArray);
     SetMeshInfoAndCanonize(meshInfo, bufferData);
 
-    VertexBuffer vertexBuffer = CreateVertexBuffer<Vector3>(bufferData, map, type);
+    VertexBuffer vertexBuffer = CreateVertexBuffer<Vector3>(bufferData, std::move(map), type);
     meshInfo.geometry.AddVertexBuffer(vertexBuffer);
   }
 }
@@ -410,9 +410,9 @@ void SetAttributeBufferData(MeshInfo& meshInfo, std::string path, std::vector<Ac
   if(accessorIdx >= 0)
   {
     Dali::Vector<T> bufferData;
-    LoadDataFromAccessor(accessorIdx, bufferData, path, accessorArray, bufferViewArray, bufferArray);
+    LoadDataFromAccessor(accessorIdx, bufferData, std::move(path), accessorArray, bufferViewArray, bufferArray);
 
-    VertexBuffer vertexBuffer = CreateVertexBuffer<T>(bufferData, map, type);
+    VertexBuffer vertexBuffer = CreateVertexBuffer<T>(bufferData, std::move(map), type);
     meshInfo.geometry.AddVertexBuffer(vertexBuffer);
   }
 }
@@ -420,7 +420,7 @@ void SetAttributeBufferData(MeshInfo& meshInfo, std::string path, std::vector<Ac
 void SetIndexBuffersData(MeshInfo& meshInfo, std::string path, std::vector<AccessorInfo>& accessorArray, std::vector<BufferViewInfo>& bufferViewArray, std::vector<BufferInfo>& bufferArray, int32_t indexIdx)
 {
   Dali::Vector<uint16_t> indexBufferData;
-  LoadDataFromAccessor(indexIdx, indexBufferData, path, accessorArray, bufferViewArray, bufferArray);
+  LoadDataFromAccessor(indexIdx, indexBufferData, std::move(path), accessorArray, bufferViewArray, bufferArray);
   meshInfo.geometry.SetIndexBuffer(&indexBufferData[0], indexBufferData.Size());
 }
 
index 6d6e211..fbf63f6 100644 (file)
@@ -1920,8 +1920,7 @@ Property::Value ItemView::GetProperty(BaseObject* object, Property::Index index)
 
       case Toolkit::ItemView::Property::LAYOUT:
       {
-        Property::Array layouts = itemViewImpl.GetLayoutArray();
-        value                   = layouts;
+        value = itemViewImpl.GetLayoutArray();
         break;
       }
     }
index e8274d1..1b4c749 100644 (file)
@@ -148,12 +148,12 @@ void Tooltip::CreatePropertyMap(Property::Map& map) const
   if(!mContentTextVisual.Empty())
   {
     Property::Map content = mContentTextVisual; // Need this copy as there's no Value constructor which takes in a 'const Property::Map&'.
-    map.Insert(Toolkit::Tooltip::Property::CONTENT, content);
+    map.Insert(Toolkit::Tooltip::Property::CONTENT, std::move(content));
   }
   else if(!mContentArray.Empty())
   {
     Property::Array content = mContentArray; // Need this copy as there's no Value constructor which takes in a 'const Property::Array&'.
-    map.Insert(Toolkit::Tooltip::Property::CONTENT, content);
+    map.Insert(Toolkit::Tooltip::Property::CONTENT, std::move(content));
   }
 
   map.Insert(Toolkit::Tooltip::Property::LAYOUT, mLayout);