diff options
author | George Marques <george@gmarqu.es> | 2020-12-27 11:09:06 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2020-12-27 11:14:29 -0300 |
commit | d66a58a4d48fcc44334a870190176a4a1278c390 (patch) | |
tree | 19e64a7750435c193ed55976336e1da855500e10 /core/variant/variant_utility.cpp | |
parent | d55e335026e4848d4d2ec21db8f334a9429c8cc8 (diff) | |
download | redot-engine-d66a58a4d48fcc44334a870190176a4a1278c390.tar.gz |
Add helper count function to Variant
To get counts of items before getting the list, which is useful for
GDNative so users can pre-allocate the buffer with the correct size
without having to get the list twice.
Diffstat (limited to 'core/variant/variant_utility.cpp')
-rw-r--r-- | core/variant/variant_utility.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/variant/variant_utility.cpp b/core/variant/variant_utility.cpp index d54e223a99..46359b80ce 100644 --- a/core/variant/variant_utility.cpp +++ b/core/variant/variant_utility.cpp @@ -1379,3 +1379,7 @@ void Variant::get_utility_function_list(List<StringName> *r_functions) { r_functions->push_back(E->get()); } } + +int Variant::get_utility_function_count() { + return utility_function_name_table.size(); +} |