Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Language agnostic 从函数中提前返回_Language Agnostic - Fatal编程技术网

Language agnostic 从函数中提前返回

Language agnostic 从函数中提前返回,language-agnostic,Language Agnostic,我有精神障碍,有人能提醒我从函数中提前返回的正确术语是什么吗 private MyObject DoSomeStuff(string myValue) { //What is this called?!?!? if(myValue == string.Empty) return null; MyObject obj = new MyObject(); obj.Value = myValue; return obj; } 我可能会称之为中

我有精神障碍,有人能提醒我从函数中提前返回的正确术语是什么吗

private MyObject DoSomeStuff(string myValue)
{
    //What is this called?!?!?
    if(myValue == string.Empty)
        return null;

    MyObject obj = new MyObject();
    obj.Value = myValue;
    return obj;
}

我可能会称之为中断。或者,简单地说,提前返回。中断可能也会起作用。

我认为它被称为保护条款。

我会称之为先决条件测试。

参考文献非常好,谢谢。原来我没有忘记这个词,我一开始也不知道-