[Bf-blender-cvs] [4aeba3b90da] master: Alembic export: avoid create-and-reset of shared pointer

Sybren A. Stüvel noreply at git.blender.org
Tue May 30 13:48:17 CEST 2017


Commit: 4aeba3b90dac780d25fd04c174b5cdc4da53efd5
Author: Sybren A. Stüvel
Date:   Fri May 26 12:56:27 2017 +0200
Branches: master
https://developer.blender.org/rB4aeba3b90dac780d25fd04c174b5cdc4da53efd5

Alembic export: avoid create-and-reset of shared pointer

Constructing the shared pointer where the object is actually allocated
makes the code a bit clearer.

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

M	source/blender/alembic/intern/abc_exporter.cc

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

diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc
index ced58e4964e..0c0d73713fb 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -219,20 +219,17 @@ void AbcExporter::getShutterSamples(double step, bool time_relative,
 
 Alembic::Abc::TimeSamplingPtr AbcExporter::createTimeSampling(double step)
 {
-	TimeSamplingPtr time_sampling;
 	std::vector<double> samples;
 
 	if (m_settings.frame_start == m_settings.frame_end) {
-		time_sampling.reset(new Alembic::Abc::TimeSampling());
-		return time_sampling;
+		return TimeSamplingPtr(new Alembic::Abc::TimeSampling());
 	}
 
 	getShutterSamples(step, true, samples);
 
 	Alembic::Abc::TimeSamplingType ts(static_cast<uint32_t>(samples.size()), 1.0 / m_scene->r.frs_sec);
-	time_sampling.reset(new Alembic::Abc::TimeSampling(ts, samples));
 
-	return time_sampling;
+	return TimeSamplingPtr(new Alembic::Abc::TimeSampling(ts, samples));
 }
 
 void AbcExporter::getFrameSet(double step, std::set<double> &frames)




More information about the Bf-blender-cvs mailing list