Cleanup: pass arguments by const reference instead of value

This commit is contained in:
Campbell Barton
2024-04-03 14:40:39 +11:00
parent b03332a055
commit b24a295af1
6 changed files with 15 additions and 10 deletions

View File

@@ -49,7 +49,10 @@ class FileOutput {
public:
/* Allocate and initialize the internal render result of the file output using the give
* parameters. See the implementation for more information. */
FileOutput(std::string path, ImageFormatData format, int2 size, bool save_as_render);
FileOutput(const std::string &path,
const ImageFormatData &format,
int2 size,
bool save_as_render);
/* Free the internal render result. */
~FileOutput();

View File

@@ -36,7 +36,7 @@ class DistortionGridKey {
DistortionType type;
int2 calibration_size;
DistortionGridKey(MovieTrackingCamera camera,
DistortionGridKey(const MovieTrackingCamera &camera,
int2 size,
DistortionType type,
int2 calibration_size);

View File

@@ -22,9 +22,9 @@ class OCIOColorSpaceConversionShaderKey {
std::string target;
std::string config_cache_id;
OCIOColorSpaceConversionShaderKey(std::string source,
std::string target,
std::string config_cache_id);
OCIOColorSpaceConversionShaderKey(const std::string &source,
const std::string &target,
const std::string &config_cache_id);
uint64_t hash() const;
};

View File

@@ -30,7 +30,7 @@ namespace blender::realtime_compositor {
* Distortion Grid Key.
*/
DistortionGridKey::DistortionGridKey(MovieTrackingCamera camera,
DistortionGridKey::DistortionGridKey(const MovieTrackingCamera &camera,
int2 size,
DistortionType type,
int2 calibration_size)

View File

@@ -34,9 +34,8 @@ namespace blender::realtime_compositor {
* OCIO Color Space Conversion Shader Key.
*/
OCIOColorSpaceConversionShaderKey::OCIOColorSpaceConversionShaderKey(std::string source,
std::string target,
std::string config_cache_id)
OCIOColorSpaceConversionShaderKey::OCIOColorSpaceConversionShaderKey(
const std::string &source, const std::string &target, const std::string &config_cache_id)
: source(source), target(target), config_cache_id(config_cache_id)
{
}

View File

@@ -34,7 +34,10 @@ namespace blender::realtime_compositor {
* File Output
*/
FileOutput::FileOutput(std::string path, ImageFormatData format, int2 size, bool save_as_render)
FileOutput::FileOutput(const std::string &path,
const ImageFormatData &format,
int2 size,
bool save_as_render)
: path_(path), format_(format), save_as_render_(save_as_render)
{
render_result_ = MEM_cnew<RenderResult>("Temporary Render Result For File Output");