diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-21 11:43:19 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-21 11:43:19 +0100 |
commit | 92993c64c6e778836eed393ee905afbcc503e2e2 (patch) | |
tree | 6cae38f3a14edb001d8ba574046556b94ac47096 /servers/rendering/shader_language.cpp | |
parent | 404184105ed89a1b5b1069a96f51b34c60ed9146 (diff) | |
parent | 28af8707505a6bd33a83a3fbaa88bac88d9c414b (diff) |
Merge pull request #68025 from Sauermann/fix-cppcheck-code-simplifications
Code simplifications found by cppcheck
Diffstat (limited to 'servers/rendering/shader_language.cpp')
-rw-r--r-- | servers/rendering/shader_language.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index 62f061c9c0..79fbc59b06 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -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 { |