diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-04-05 16:53:29 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-04-05 18:39:52 -0300 |
commit | 8752f1655bbd65cd5588fa6246c1fe274e2a0f5e (patch) | |
tree | ca7022de2a39656d88da78fd9e15e39cbd0d2409 | |
parent | 319e5f2467e8682865f1206ae4ce4b3e2bdff147 (diff) |
Do not write Py_RETURN_FALSE twice.
-rw-r--r-- | cppgenerator.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp index c1881a44f..a0a8eec5c 100644 --- a/cppgenerator.cpp +++ b/cppgenerator.cpp @@ -2152,7 +2152,7 @@ void CppGenerator::writeRichCompareFunction(QTextStream& s, const AbstractMetaCl s << baseName << "_richcompare(PyObject* self, PyObject* other, int op)" << endl; s << '{' << endl; QList<AbstractMetaFunctionList> cmpOverloads = filterGroupedOperatorFunctions(metaClass, AbstractMetaClass::ComparisonOp); - s << INDENT << "bool result;" << endl; + s << INDENT << "bool result = false;" << endl; s << INDENT << metaClass->qualifiedCppName() << "& cpp_self = *" << cpythonWrapperCPtr(metaClass) << ';' << endl; s << endl; @@ -2254,12 +2254,8 @@ void CppGenerator::writeRichCompareFunction(QTextStream& s, const AbstractMetaCl Indentation indent(INDENT); s << INDENT << "Py_RETURN_TRUE;" << endl; } - s << INDENT << "Py_RETURN_FALSE;" << endl << endl; s << INDENT << baseName << "_RichComparison_TypeError:" << endl; - { - Indentation indent(INDENT); - s << INDENT << "Py_RETURN_FALSE;" << endl; - } + s << INDENT << "Py_RETURN_FALSE;" << endl << endl; s << '}' << endl << endl; } |