mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #101291 from Ivorforce/stringname-to-bool
Change `StringName.operator const void *` to `explicit operator bool`.
This commit is contained in:
commit
af252823ac
2 changed files with 2 additions and 2 deletions
|
|
@ -97,7 +97,7 @@ class StringName {
|
|||
StringName(_Data *p_data) { _data = p_data; }
|
||||
|
||||
public:
|
||||
operator const void *() const { return (_data && (_data->cname || !_data->name.is_empty())) ? (void *)1 : nullptr; }
|
||||
explicit operator bool() const { return _data && (_data->cname || !_data->name.is_empty()); }
|
||||
|
||||
bool operator==(const String &p_name) const;
|
||||
bool operator==(const char *p_name) const;
|
||||
|
|
|
|||
|
|
@ -872,7 +872,7 @@ static String _make_arguments_hint(const GDScriptParser::FunctionNode *p_functio
|
|||
|
||||
static void _get_directory_contents(EditorFileSystemDirectory *p_dir, HashMap<String, ScriptLanguage::CodeCompletionOption> &r_list, const StringName &p_required_type = StringName()) {
|
||||
const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\"";
|
||||
const bool requires_type = p_required_type;
|
||||
const bool requires_type = !p_required_type.is_empty();
|
||||
|
||||
for (int i = 0; i < p_dir->get_file_count(); i++) {
|
||||
if (requires_type && !ClassDB::is_parent_class(p_dir->get_file_type(i), p_required_type)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue