1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-06 19:41:11 +00:00

Code simplifications found by cppcheck

They are based on:
- Boolean arithmetic simplifications
- setting variables that are not accessed
- constant variables
This commit is contained in:
Markus Sauermann
2022-10-28 01:39:28 +02:00
parent dce1602eda
commit 28af870750
15 changed files with 11 additions and 41 deletions

View File

@@ -7590,7 +7590,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const FunctionInfo &p_fun
return ERR_BUG;
}
if (b && b->parent_function && p_function_info.main_function) {
if (b->parent_function && p_function_info.main_function) {
_set_error(vformat(RTR("Using '%s' in the '%s' processor function is incorrect."), "return", b->parent_function->name));
return ERR_PARSE_ERROR;
}
@@ -8880,7 +8880,7 @@ Error ShaderLanguage::_parse_shader(const HashMap<StringName, FunctionInfo> &p_f
_set_error(RTR("Expected an uniform group identifier or `;`."));
}
return ERR_PARSE_ERROR;
} else if (tk.type == TK_SEMICOLON && current_uniform_group_name.is_empty()) {
} else if (current_uniform_group_name.is_empty()) {
_set_error(RTR("Group needs to be opened before."));
return ERR_PARSE_ERROR;
} else {