Optimize my dumb code that do stuff with a QByteArray without knowing if will use it.

This commit is contained in:
Hugo Parente Lima 2011-08-30 15:53:36 -03:00
commit f5f9c23c5f

View file

@ -783,12 +783,13 @@ void registerSignals(SbkObjectType* pyObj, const QMetaObject* metaObject)
SignalSigMap signalsFound; SignalSigMap signalsFound;
for(int i = metaObject->methodOffset(), max = metaObject->methodCount(); i < max; ++i) { for(int i = metaObject->methodOffset(), max = metaObject->methodCount(); i < max; ++i) {
QMetaMethod method = metaObject->method(i); QMetaMethod method = metaObject->method(i);
if (method.methodType() == QMetaMethod::Signal) {
QByteArray methodName(method.signature()); QByteArray methodName(method.signature());
methodName.chop(methodName.size() - methodName.indexOf('(')); methodName.chop(methodName.size() - methodName.indexOf('('));
if (method.methodType() == QMetaMethod::Signal)
signalsFound[methodName] << join(method.parameterTypes(), ","); signalsFound[methodName] << join(method.parameterTypes(), ",");
} }
}
SignalSigMap::Iterator it = signalsFound.begin(); SignalSigMap::Iterator it = signalsFound.begin();
SignalSigMap::Iterator end = signalsFound.end(); SignalSigMap::Iterator end = signalsFound.end();