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 b124d22d30a4e5ad4aa72f08c92536da295d3b8f..d85f8fd0f6a2ec7c3545fadb43ec33cdf98c109b 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 548a4c9d554bca6a9f4013b6e5eca95818d17cb9..a837b7775e17ad3abbddb1d350ee9602d6ce46c9 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 c25e3d0cf5060c1e90a669e352ba6d7ac56a7da3..8bcc9787d5bfd6827e2236db015d89eb7798b5b5 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 6d6e2112125bcb5a07d1bcaf8862bd30963663de..fbf63f6ffc5b6df74d57b7b051baeeeb8f50bbb2 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 e8274d1558ecbaa58421041b338caf64b2a5365b..1b4c749524153ab3ba1f49bc40010a130e5afca2 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);