1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Replace Array return types with TypedArray

This commit is contained in:
kobewi
2022-08-05 03:41:48 +02:00
parent b9ea0e1338
commit 8be27dc59e
110 changed files with 298 additions and 272 deletions

View File

@@ -76,7 +76,7 @@
</description>
</method>
<method name="get_names" qualifiers="const">
<return type="Array" />
<return type="PackedStringArray" />
<description>
Returns an array of names of named capturing groups in the compiled pattern. They are ordered by appearance.
</description>

View File

@@ -351,8 +351,8 @@ int RegEx::get_group_count() const {
return count;
}
Array RegEx::get_names() const {
Array result;
PackedStringArray RegEx::get_names() const {
PackedStringArray result;
ERR_FAIL_COND_V(!is_valid(), result);

View File

@@ -94,7 +94,7 @@ public:
bool is_valid() const;
String get_pattern() const;
int get_group_count() const;
Array get_names() const;
PackedStringArray get_names() const;
RegEx();
RegEx(const String &p_pattern);

View File

@@ -46,7 +46,7 @@ TEST_CASE("[RegEx] Initialization") {
CHECK(re1.get_pattern() == pattern);
CHECK(re1.get_group_count() == 1);
Array names = re1.get_names();
PackedStringArray names = re1.get_names();
CHECK(names.size() == 1);
CHECK(names[0] == "vowel");