From adbe948bda202209b55249198e1837324e703ddb Mon Sep 17 00:00:00 2001 From: Anilforextra Date: Thu, 3 Feb 2022 21:48:38 +0545 Subject: String: Add contains(). --- modules/gdnative/nativescript/api_generator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/gdnative') diff --git a/modules/gdnative/nativescript/api_generator.cpp b/modules/gdnative/nativescript/api_generator.cpp index ddde28811c..0309d1d9c7 100644 --- a/modules/gdnative/nativescript/api_generator.cpp +++ b/modules/gdnative/nativescript/api_generator.cpp @@ -288,7 +288,7 @@ List generate_c_api_classes() { String type; String name = argument.name; - if (argument.name.find(":") != -1) { + if (argument.name.contains(":")) { type = argument.name.get_slice(":", 1); name = argument.name.get_slice(":", 0); } else { @@ -324,7 +324,7 @@ List generate_c_api_classes() { property_api.getter = ClassDB::get_property_getter(class_name, p->get().name); property_api.setter = ClassDB::get_property_setter(class_name, p->get().name); - if (p->get().name.find(":") != -1) { + if (p->get().name.contains(":")) { property_api.type = p->get().name.get_slice(":", 1); property_api.name = p->get().name.get_slice(":", 0); } else { @@ -355,7 +355,7 @@ List generate_c_api_classes() { //method name method_api.method_name = method_info.name; //method return type - if (method_api.method_name.find(":") != -1) { + if (method_api.method_name.contains(":")) { method_api.return_type = method_api.method_name.get_slice(":", 1); method_api.method_name = method_api.method_name.get_slice(":", 0); } else { @@ -388,7 +388,7 @@ List generate_c_api_classes() { arg_name = arg_info.name; - if (arg_info.name.find(":") != -1) { + if (arg_info.name.contains(":")) { arg_type = arg_info.name.get_slice(":", 1); arg_name = arg_info.name.get_slice(":", 0); } else if (arg_info.hint == PROPERTY_HINT_RESOURCE_TYPE) { -- cgit v1.2.3