Extract repeating checks

This commit is contained in:
Dmitry-Me 2017-09-04 23:58:14 +03:00
parent d02d235e5e
commit 7c8cb29d14
1 changed files with 5 additions and 5 deletions

View File

@ -423,13 +423,13 @@ bool CheckClass::canNotMove(const Scope *scope)
for (func = scope->functionList.begin(); func != scope->functionList.end(); ++func) {
if (func->isConstructor())
constructor = true;
if ((func->type == Function::eCopyConstructor) &&
func->access == Public)
if (func->access != Public)
continue;
if (func->type == Function::eCopyConstructor)
publicCopy = true;
else if ((func->type == Function::eMoveConstructor) &&
func->access == Public)
else if (func->type == Function::eMoveConstructor)
publicMove = true;
else if (func->type == Function::eOperatorEqual && func->access == Public)
else if (func->type == Function::eOperatorEqual)
publicAssign = true;
}