Replace String comparisons with "", String() to is_empty()
Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
This commit is contained in:
@ -205,7 +205,7 @@ Vector<uint8_t> RenderingDevice::_shader_compile_binary_from_spirv(const Ref<RDS
|
||||
ShaderStageSPIRVData sd;
|
||||
sd.shader_stage = stage;
|
||||
String error = p_spirv->get_stage_compile_error(stage);
|
||||
ERR_FAIL_COND_V_MSG(error != String(), Vector<uint8_t>(), "Can't create a shader from an errored bytecode. Check errors in source bytecode.");
|
||||
ERR_FAIL_COND_V_MSG(!error.is_empty(), Vector<uint8_t>(), "Can't create a shader from an errored bytecode. Check errors in source bytecode.");
|
||||
sd.spir_v = p_spirv->get_stage_bytecode(stage);
|
||||
if (sd.spir_v.is_empty()) {
|
||||
continue;
|
||||
@ -225,7 +225,7 @@ RID RenderingDevice::_shader_create_from_spirv(const Ref<RDShaderSPIRV> &p_spirv
|
||||
ShaderStageSPIRVData sd;
|
||||
sd.shader_stage = stage;
|
||||
String error = p_spirv->get_stage_compile_error(stage);
|
||||
ERR_FAIL_COND_V_MSG(error != String(), RID(), "Can't create a shader from an errored bytecode. Check errors in source bytecode.");
|
||||
ERR_FAIL_COND_V_MSG(!error.is_empty(), RID(), "Can't create a shader from an errored bytecode. Check errors in source bytecode.");
|
||||
sd.spir_v = p_spirv->get_stage_bytecode(stage);
|
||||
if (sd.spir_v.is_empty()) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user