瀏覽代碼

Make the default return value on crash explicit

Noticed that the error condition will return a NULL instead of something more explicit like "false".
Should make the code more readable at a glance.
hbina085 6 年之前
父節點
當前提交
26c0609656
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      servers/visual/shader_language.cpp

+ 2 - 2
servers/visual/shader_language.cpp

@@ -2054,11 +2054,11 @@ const ShaderLanguage::BuiltinFuncOutArgs ShaderLanguage::builtin_func_out_args[]
 
 bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p_func, DataType *r_ret_type) {
 
-	ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, NULL);
+	ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, false);
 
 	Vector<DataType> args;
 
-	ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, NULL);
+	ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, false);
 
 	StringName name = static_cast<VariableNode *>(p_func->arguments[0])->name.operator String();