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,11 +783,12 @@ 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);
QByteArray methodName(method.signature());
methodName.chop(methodName.size() - methodName.indexOf('('));
if (method.methodType() == QMetaMethod::Signal) if (method.methodType() == QMetaMethod::Signal) {
QByteArray methodName(method.signature());
methodName.chop(methodName.size() - methodName.indexOf('('));
signalsFound[methodName] << join(method.parameterTypes(), ","); signalsFound[methodName] << join(method.parameterTypes(), ",");
}
} }
SignalSigMap::Iterator it = signalsFound.begin(); SignalSigMap::Iterator it = signalsFound.begin();