Vectors: Use clear() and has().
Use clear() instead of resize(0). Use has() instead of "find(p_val) != -1".
This commit is contained in:
@ -7476,7 +7476,7 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
|
||||
|
||||
const String smode = String(mode);
|
||||
|
||||
if (shader->render_modes.find(mode) != -1) {
|
||||
if (shader->render_modes.has(mode)) {
|
||||
_set_error(vformat(RTR("Duplicated render mode: '%s'."), smode));
|
||||
return ERR_PARSE_ERROR;
|
||||
}
|
||||
@ -7489,7 +7489,7 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
|
||||
|
||||
if (smode.begins_with(name)) {
|
||||
if (!info.options.is_empty()) {
|
||||
if (info.options.find(smode.substr(name.length() + 1)) != -1) {
|
||||
if (info.options.has(smode.substr(name.length() + 1))) {
|
||||
found = true;
|
||||
|
||||
if (defined_modes.has(name)) {
|
||||
|
||||
Reference in New Issue
Block a user