[Bf-blender-cvs] [5d3533f4d54] soc-2020-io-performance: Cleanup: use `std::make_unique` instead of new.

Ankit Meel noreply at git.blender.org
Sat Nov 7 14:17:39 CET 2020


Commit: 5d3533f4d54bc3699d6af9ca26503a46af21bdea
Author: Ankit Meel
Date:   Sat Nov 7 18:33:17 2020 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rB5d3533f4d54bc3699d6af9ca26503a46af21bdea

Cleanup: use `std::make_unique` instead of new.

===================================================================

M	source/blender/io/wavefront_obj/exporter/obj_exporter.cc

===================================================================

diff --git a/source/blender/io/wavefront_obj/exporter/obj_exporter.cc b/source/blender/io/wavefront_obj/exporter/obj_exporter.cc
index 05c13a9e0f9..6d66309516b 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_exporter.cc
+++ b/source/blender/io/wavefront_obj/exporter/obj_exporter.cc
@@ -98,7 +98,7 @@ find_exportable_objects(Depsgraph *depsgraph, const OBJExportParams &export_para
         ATTR_FALLTHROUGH;
       case OB_MESH: {
         r_exportable_meshes.append(
-            std::unique_ptr<OBJMesh>(new OBJMesh(depsgraph, export_params, object_in_layer)));
+            std::make_unique<OBJMesh>(depsgraph, export_params, object_in_layer));
         break;
       }
       case OB_CURVE: {
@@ -108,20 +108,20 @@ find_exportable_objects(Depsgraph *depsgraph, const OBJExportParams &export_para
           case CU_NURBS: {
             if (export_params.export_curves_as_nurbs) {
               /* Export in parameter form: control points. */
-              r_exportable_nurbs.append(std::unique_ptr<OBJCurve>(
-                  new OBJCurve(depsgraph, export_params, object_in_layer)));
+              r_exportable_nurbs.append(
+                  std::make_unique<OBJCurve>(depsgraph, export_params, object_in_layer));
             }
             else {
               /* Export in mesh form: edges and vertices. */
-              r_exportable_meshes.append(std::unique_ptr<OBJMesh>(
-                  new OBJMesh(depsgraph, export_params, object_in_layer)));
+              r_exportable_meshes.append(
+                  std::make_unique<OBJMesh>(depsgraph, export_params, object_in_layer));
             }
             break;
           }
           case CU_BEZIER: {
             /* Always export in mesh form: edges and vertices. */
             r_exportable_meshes.append(
-                std::unique_ptr<OBJMesh>(new OBJMesh(depsgraph, export_params, object_in_layer)));
+                std::make_unique<OBJMesh>(depsgraph, export_params, object_in_layer));
             break;
           }
           default: {



More information about the Bf-blender-cvs mailing list