summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorqarmin <mikrutrafal54@gmail.com>2019-07-10 11:54:12 +0200
committerqarmin <mikrutrafal54@gmail.com>2019-07-10 11:54:12 +0200
commit01cc7a996babc9173a393bf3dae080dc14a277c9 (patch)
treecc57520aebe056553aeb8999ef90f9c71cace392 /core
parent3bfffcc568d87342e867f95c35a4a19e09072189 (diff)
Use reference to constant in functions
Diffstat (limited to 'core')
-rw-r--r--core/class_db.cpp4
-rw-r--r--core/class_db.h4
-rw-r--r--core/math/basis.cpp2
-rw-r--r--core/math/basis.h2
-rw-r--r--core/project_settings.cpp6
-rw-r--r--core/project_settings.h6
6 files changed, 12 insertions, 12 deletions
diff --git a/core/class_db.cpp b/core/class_db.cpp
index 2cbf53ba0b..794d990083 100644
--- a/core/class_db.cpp
+++ b/core/class_db.cpp
@@ -1148,7 +1148,7 @@ Variant::Type ClassDB::get_property_type(const StringName &p_class, const String
return Variant::NIL;
}
-StringName ClassDB::get_property_setter(StringName p_class, const StringName p_property) {
+StringName ClassDB::get_property_setter(StringName p_class, const StringName &p_property) {
ClassInfo *type = classes.getptr(p_class);
ClassInfo *check = type;
@@ -1165,7 +1165,7 @@ StringName ClassDB::get_property_setter(StringName p_class, const StringName p_p
return StringName();
}
-StringName ClassDB::get_property_getter(StringName p_class, const StringName p_property) {
+StringName ClassDB::get_property_getter(StringName p_class, const StringName &p_property) {
ClassInfo *type = classes.getptr(p_class);
ClassInfo *check = type;
diff --git a/core/class_db.h b/core/class_db.h
index 237ae9b806..3d9a695f02 100644
--- a/core/class_db.h
+++ b/core/class_db.h
@@ -337,8 +337,8 @@ public:
static bool has_property(const StringName &p_class, const StringName &p_property, bool p_no_inheritance = false);
static int get_property_index(const StringName &p_class, const StringName &p_property, bool *r_is_valid = NULL);
static Variant::Type get_property_type(const StringName &p_class, const StringName &p_property, bool *r_is_valid = NULL);
- static StringName get_property_setter(StringName p_class, const StringName p_property);
- static StringName get_property_getter(StringName p_class, const StringName p_property);
+ static StringName get_property_setter(StringName p_class, const StringName &p_property);
+ static StringName get_property_getter(StringName p_class, const StringName &p_property);
static bool has_method(StringName p_class, StringName p_method, bool p_no_inheritance = false);
static void set_method_flags(StringName p_class, StringName p_method, int p_flags);
diff --git a/core/math/basis.cpp b/core/math/basis.cpp
index 1540bc8fe1..400f342018 100644
--- a/core/math/basis.cpp
+++ b/core/math/basis.cpp
@@ -852,7 +852,7 @@ void Basis::set_quat_scale(const Quat &p_quat, const Vector3 &p_scale) {
rotate(p_quat);
}
-void Basis::set_diagonal(const Vector3 p_diag) {
+void Basis::set_diagonal(const Vector3 &p_diag) {
elements[0][0] = p_diag.x;
elements[0][1] = 0;
elements[0][2] = 0;
diff --git a/core/math/basis.h b/core/math/basis.h
index 75037c2c52..d3adad3d90 100644
--- a/core/math/basis.h
+++ b/core/math/basis.h
@@ -153,7 +153,7 @@ public:
int get_orthogonal_index() const;
void set_orthogonal_index(int p_index);
- void set_diagonal(const Vector3 p_diag);
+ void set_diagonal(const Vector3 &p_diag);
bool is_orthogonal() const;
bool is_diagonal() const;
diff --git a/core/project_settings.cpp b/core/project_settings.cpp
index 3597e2b818..c1d4967f55 100644
--- a/core/project_settings.cpp
+++ b/core/project_settings.cpp
@@ -487,7 +487,7 @@ void ProjectSettings::set_registering_order(bool p_enable) {
registering_order = p_enable;
}
-Error ProjectSettings::_load_settings_binary(const String p_path) {
+Error ProjectSettings::_load_settings_binary(const String &p_path) {
Error err;
FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err);
@@ -530,7 +530,7 @@ Error ProjectSettings::_load_settings_binary(const String p_path) {
return OK;
}
-Error ProjectSettings::_load_settings_text(const String p_path) {
+Error ProjectSettings::_load_settings_text(const String &p_path) {
Error err;
FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err);
@@ -593,7 +593,7 @@ Error ProjectSettings::_load_settings_text(const String p_path) {
}
}
-Error ProjectSettings::_load_settings_text_or_binary(const String p_text_path, const String p_bin_path) {
+Error ProjectSettings::_load_settings_text_or_binary(const String &p_text_path, const String &p_bin_path) {
// Attempt first to load the text-based project.godot file
Error err_text = _load_settings_text(p_text_path);
diff --git a/core/project_settings.h b/core/project_settings.h
index 0ff18ab3f5..d7651417d5 100644
--- a/core/project_settings.h
+++ b/core/project_settings.h
@@ -97,9 +97,9 @@ protected:
static ProjectSettings *singleton;
- Error _load_settings_text(const String p_path);
- Error _load_settings_binary(const String p_path);
- Error _load_settings_text_or_binary(const String p_text_path, const String p_bin_path);
+ Error _load_settings_text(const String &p_path);
+ Error _load_settings_binary(const String &p_path);
+ Error _load_settings_text_or_binary(const String &p_text_path, const String &p_bin_path);
Error _save_settings_text(const String &p_file, const Map<String, List<String> > &props, const CustomMap &p_custom = CustomMap(), const String &p_custom_features = String());
Error _save_settings_binary(const String &p_file, const Map<String, List<String> > &props, const CustomMap &p_custom = CustomMap(), const String &p_custom_features = String());