Break loop early

This commit is contained in:
Dmitry-Me 2017-09-05 00:00:02 +03:00
parent 7c8cb29d14
commit 79f74fc4d3
1 changed files with 7 additions and 3 deletions

View File

@ -425,12 +425,16 @@ bool CheckClass::canNotMove(const Scope *scope)
constructor = true;
if (func->access != Public)
continue;
if (func->type == Function::eCopyConstructor)
if (func->type == Function::eCopyConstructor) {
publicCopy = true;
else if (func->type == Function::eMoveConstructor)
break;
} else if (func->type == Function::eMoveConstructor) {
publicMove = true;
else if (func->type == Function::eOperatorEqual)
break;
} else if (func->type == Function::eOperatorEqual) {
publicAssign = true;
break;
}
}
return constructor && !(publicAssign || publicCopy || publicMove);