返回函数后需要休息一下吗?

ami*_*lou 3 c++ oop

这是我的代码中的一个函数:

bool same_community(string s1, string s2)//check if student 1 & student 2 are in the same community
{
for(int i=0;i<number_of_communities;i++)    
    if(community[i].contains(s1) && community[i].contains(s2))
    {
        return true;
        break;
    }
return false
}
Run Code Online (Sandbox Code Playgroud)

return true 后是否需要中断?

Ada*_*eld 5

不。它是死代码,很可能会被编译器的优化器删除。删除它,因为它会降低代码的可读性。