diff options
| author | Ben Rog-Wilhelm <zorba-githubdesktop20180420@pavlovian.net> | 2018-12-08 00:54:12 -0800 |
|---|---|---|
| committer | Ben Rog-Wilhelm <zorba-githubdesktop20180420@pavlovian.net> | 2018-12-08 00:54:12 -0800 |
| commit | b26487a2b46e6a15af2cbbed88755fd33d35e935 (patch) | |
| tree | 18a32ab01c83814c10612b35d9217cf68c405d74 /modules/mono/mono_gd/gd_mono_class.cpp | |
| parent | f13f2d512f0439a29804182cee756dce62add857 (diff) | |
| download | redot-engine-b26487a2b46e6a15af2cbbed88755fd33d35e935.tar.gz | |
Tweaks after feedback
Diffstat (limited to 'modules/mono/mono_gd/gd_mono_class.cpp')
| -rw-r--r-- | modules/mono/mono_gd/gd_mono_class.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/modules/mono/mono_gd/gd_mono_class.cpp b/modules/mono/mono_gd/gd_mono_class.cpp index 400735bb20..c55f9160bd 100644 --- a/modules/mono/mono_gd/gd_mono_class.cpp +++ b/modules/mono/mono_gd/gd_mono_class.cpp @@ -139,20 +139,6 @@ void GDMonoClass::fetch_attributes() { attrs_fetched = true; } -void GDMonoClass::fetch_method_list() { - - if (method_list_fetched) - return; - - void *iter = NULL; - MonoMethod *raw_method = NULL; - while ((raw_method = mono_class_get_methods(get_mono_ptr(), &iter)) != NULL) { - method_list.push_back(memnew(GDMonoMethod(mono_method_get_name(raw_method), raw_method))); - } - - method_list_fetched = true; -} - void GDMonoClass::fetch_methods_with_godot_api_checks(GDMonoClass *p_native_base) { CRASH_COND(!CACHED_CLASS(GodotObject)->is_assignable_from(this)); @@ -465,8 +451,16 @@ const Vector<GDMonoClass *> &GDMonoClass::get_all_delegates() { } const Vector<GDMonoMethod *> &GDMonoClass::get_all_methods() { - if (!method_list_fetched) - fetch_method_list(); + + if (!method_list_fetched) { + void *iter = NULL; + MonoMethod *raw_method = NULL; + while ((raw_method = mono_class_get_methods(get_mono_ptr(), &iter)) != NULL) { + method_list.push_back(memnew(GDMonoMethod(mono_method_get_name(raw_method), raw_method))); + } + + method_list_fetched = true; + } return method_list; } |
