mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Merge pull request #29941 from qarmin/redundant_code_and_others
Remove redundant code, possible NULL pointers and others
This commit is contained in:
commit
eaaff9da31
175 changed files with 467 additions and 674 deletions
|
@ -1149,7 +1149,7 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s
|
|||
|
||||
if (!expr) {
|
||||
ERR_EXPLAIN("GDScriptParser bug, couldn't figure out what expression is...");
|
||||
ERR_FAIL_COND_V(!expr, NULL);
|
||||
ERR_FAIL_V(NULL);
|
||||
}
|
||||
|
||||
/******************/
|
||||
|
@ -1492,7 +1492,7 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s
|
|||
if (next_op == -1) {
|
||||
|
||||
_set_error("Yet another parser bug....");
|
||||
ERR_FAIL_COND_V(next_op == -1, NULL);
|
||||
ERR_FAIL_V(NULL);
|
||||
}
|
||||
|
||||
// OK! create operator..
|
||||
|
@ -5943,11 +5943,8 @@ bool GDScriptParser::_is_type_compatible(const DataType &p_container, const Data
|
|||
|
||||
if (p_container.kind == DataType::BUILTIN && p_container.builtin_type == Variant::OBJECT) {
|
||||
// Object built-in is a special case, it's compatible with any object and with null
|
||||
if (p_expression.kind == DataType::BUILTIN && p_expression.builtin_type == Variant::NIL) {
|
||||
return true;
|
||||
}
|
||||
if (p_expression.kind == DataType::BUILTIN) {
|
||||
return false;
|
||||
return p_expression.builtin_type == Variant::NIL;
|
||||
}
|
||||
// If it's not a built-in, must be an object
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue