Skip to content

Commit

Permalink
Don't check _id if we don't need to
Browse files Browse the repository at this point in the history
So it avoids warning with static analysis
  • Loading branch information
ogoffart committed Mar 13, 2017
1 parent d1a5cd9 commit 87084cf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -741,9 +741,11 @@ void Generator::GenerateMetaCall()
OS_TemplateHeader << "\n" << TemplatePrefix << "int " << QualName
<< "::qt_metacall(QMetaObject::Call _c, int _id, void **_a)\n{\n";
if (!BaseName.empty()) {
OS_TemplateHeader << " _id = " << BaseName << "::qt_metacall(_c, _id, _a);\n"
" if (_id < 0)\n"
" return _id;\n";
OS_TemplateHeader << " _id = " << BaseName << "::qt_metacall(_c, _id, _a);\n";
if (MethodCount || CDef->Properties.size()) {
OS_TemplateHeader << " if (_id < 0)\n"
" return _id;\n";
};
}

if (MethodCount) {
Expand Down Expand Up @@ -809,7 +811,7 @@ void Generator::GenerateMetaCall()
HandleQueryPropertyAction(needUser, "QueryPropertyUser", &PropertyDef::user);

}
OS_TemplateHeader << "\n return _id;"
OS_TemplateHeader << "\n return _id;\n"
"}\n";
}

Expand Down

0 comments on commit 87084cf

Please sign in to comment.