Cleanup: pass arguments by const reference
This commit is contained in:
parent
4e650294e2
commit
0ef033750f
|
@ -501,7 +501,7 @@ std::string Draw::serialize() const
|
|||
")";
|
||||
}
|
||||
|
||||
std::string DrawMulti::serialize(std::string line_prefix) const
|
||||
std::string DrawMulti::serialize(const std::string &line_prefix) const
|
||||
{
|
||||
DrawMultiBuf::DrawGroupBuf &groups = multi_draw_buf->group_buf_;
|
||||
|
||||
|
|
|
@ -371,7 +371,7 @@ struct DrawMulti {
|
|||
uint uuid;
|
||||
|
||||
void execute(RecordingState &state) const;
|
||||
std::string serialize(std::string line_prefix) const;
|
||||
std::string serialize(const std::string &line_prefix) const;
|
||||
};
|
||||
|
||||
struct DrawIndirect {
|
||||
|
|
|
@ -123,7 +123,7 @@ void VolumeModifierData::write_transform()
|
|||
transform *= gf_matrix_from_transform(object->object_to_world().ptr());
|
||||
}
|
||||
|
||||
std::string VolumeModifierData::get_cached_file_path(std::string directory, int frame)
|
||||
std::string VolumeModifierData::get_cached_file_path(const std::string &directory, int frame)
|
||||
{
|
||||
char file_path[FILE_MAX];
|
||||
char file_name[32];
|
||||
|
|
|
@ -25,7 +25,7 @@ class VolumeModifierData : public VolumeData {
|
|||
void write_transform() override;
|
||||
|
||||
private:
|
||||
std::string get_cached_file_path(std::string directory, int frame);
|
||||
std::string get_cached_file_path(const std::string &directory, int frame);
|
||||
|
||||
const FluidModifierData *modifier_;
|
||||
};
|
||||
|
|
|
@ -161,7 +161,7 @@ class ObjExporterWriterTest : public testing::Test {
|
|||
}
|
||||
|
||||
std::unique_ptr<OBJWriter> init_writer(const OBJExportParams ¶ms,
|
||||
const std::string out_filepath)
|
||||
const std::string &out_filepath)
|
||||
{
|
||||
try {
|
||||
auto writer = std::make_unique<OBJWriter>(out_filepath.c_str(), params);
|
||||
|
|
|
@ -970,7 +970,7 @@ static int rna_Sequence_input_count_get(PointerRNA *ptr)
|
|||
}
|
||||
|
||||
static void rna_Sequence_input_set(PointerRNA *ptr,
|
||||
PointerRNA ptr_value,
|
||||
const PointerRNA &ptr_value,
|
||||
ReportList *reports,
|
||||
int input_num)
|
||||
{
|
||||
|
|
|
@ -316,7 +316,7 @@ static _inittab bpy_internal_modules[] = {
|
|||
* Show an error just to avoid silent failure in the unlikely event something goes wrong,
|
||||
* in this case a developer will need to track down the root cause.
|
||||
*/
|
||||
static void pystatus_exit_on_error(PyStatus status)
|
||||
static void pystatus_exit_on_error(const PyStatus &status)
|
||||
{
|
||||
if (UNLIKELY(PyStatus_Exception(status))) {
|
||||
fputs("Internal error initializing Python!\n", stderr);
|
||||
|
|
|
@ -620,7 +620,7 @@ class RetimingRange {
|
|||
|
||||
/* Create new range representing overlap of 2 ranges.
|
||||
* Returns overlapping range. */
|
||||
RetimingRange operator*(const RetimingRange rhs_range)
|
||||
RetimingRange operator*(const RetimingRange &rhs_range)
|
||||
{
|
||||
RetimingRange new_range = RetimingRange(0, 0, 0, LINEAR);
|
||||
|
||||
|
@ -732,7 +732,7 @@ class RetimingRangeData {
|
|||
}
|
||||
}
|
||||
|
||||
RetimingRangeData &operator*=(const RetimingRangeData rhs)
|
||||
RetimingRangeData &operator*=(const RetimingRangeData &rhs)
|
||||
{
|
||||
if (ranges.is_empty()) {
|
||||
for (const RetimingRange &rhs_range : rhs.ranges) {
|
||||
|
|
Loading…
Reference in New Issue