summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-09-17 12:52:46 +0200
committerGitHub <noreply@github.com>2017-09-17 12:52:46 +0200
commita1b4e4c607acb09c13bdf1b9609f2d45c4b01e15 (patch)
treef69ff32b272c9688242a3213a047248b7da24e26
parent53990c7bb9377982a0dc5aaae7a75f046189c9bc (diff)
parent0f4643a4f6cc36b806e867100cfb710b8c3b1d3b (diff)
Merge pull request #11272 from Rubonnek/move-to-initializer-list
Moved class_name and return_val to initializer list
-rw-r--r--core/object.cpp12
-rw-r--r--core/object.h5
2 files changed, 9 insertions, 8 deletions
diff --git a/core/object.cpp b/core/object.cpp
index 23e32a214a..b1770f1d7a 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -277,32 +277,32 @@ MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyIn
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name)
: name(p_name),
flags(METHOD_FLAG_NORMAL),
+ return_val(p_ret),
id(0) {
- return_val = p_ret;
}
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1)
: name(p_name),
+ return_val(p_ret),
flags(METHOD_FLAG_NORMAL),
id(0) {
- return_val = p_ret;
arguments.push_back(p_param1);
}
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2)
: name(p_name),
+ return_val(p_ret),
flags(METHOD_FLAG_NORMAL),
id(0) {
- return_val = p_ret;
arguments.push_back(p_param1);
arguments.push_back(p_param2);
}
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3)
: name(p_name),
+ return_val(p_ret),
flags(METHOD_FLAG_NORMAL),
id(0) {
- return_val = p_ret;
arguments.push_back(p_param1);
arguments.push_back(p_param2);
arguments.push_back(p_param3);
@@ -310,9 +310,9 @@ MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const Pr
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4)
: name(p_name),
+ return_val(p_ret),
flags(METHOD_FLAG_NORMAL),
id(0) {
- return_val = p_ret;
arguments.push_back(p_param1);
arguments.push_back(p_param2);
arguments.push_back(p_param3);
@@ -321,9 +321,9 @@ MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const Pr
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5)
: name(p_name),
+ return_val(p_ret),
flags(METHOD_FLAG_NORMAL),
id(0) {
- return_val = p_ret;
arguments.push_back(p_param1);
arguments.push_back(p_param2);
arguments.push_back(p_param3);
diff --git a/core/object.h b/core/object.h
index 644e2b8270..3070439138 100644
--- a/core/object.h
+++ b/core/object.h
@@ -148,6 +148,7 @@ struct PropertyInfo {
hint(PROPERTY_HINT_NONE),
usage(PROPERTY_USAGE_DEFAULT) {
}
+
PropertyInfo(Variant::Type p_type, const String p_name, PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = "", uint32_t p_usage = PROPERTY_USAGE_DEFAULT, const StringName &p_class_name = StringName())
: type(p_type),
name(p_name),
@@ -161,12 +162,12 @@ struct PropertyInfo {
class_name = p_class_name;
}
}
+
PropertyInfo(const StringName &p_class_name)
: type(Variant::OBJECT),
+ class_name(p_class_name),
hint(PROPERTY_HINT_NONE),
usage(PROPERTY_USAGE_DEFAULT) {
-
- class_name = p_class_name;
}
bool operator<(const PropertyInfo &p_info) const {