summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2016-01-22 13:15:19 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2016-01-22 21:50:01 +0000
commite7825015328a2297c0730a6708e17a9bcf9d7f48 (patch)
tree2ebb1d269c9b6838640685a3d0ffe3a339c76c7a /src/tools
parent684e5587d5024ff9523d76141d0befd1201dc24f (diff)
Speed up QObject::connect with function pointers
When resolving the signal/slot of connect(&Foo::bar, ...) we place a meta-call to map the address to the method index. Once we have found the index, we don't need to continue but can return the result right away. Change-Id: I67bb22df394d7c22dc1731367c0961b958ed77b3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/moc/generator.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index 5be58d3c4b..99629f0427 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -1254,6 +1254,7 @@ void Generator::generateStaticMetacall()
fprintf(out, " if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&%s::%s)) {\n",
cdef->classname.constData(), f.name.constData());
fprintf(out, " *result = %d;\n", methodindex);
+ fprintf(out, " return;\n");
fprintf(out, " }\n }\n");
}
if (!anythingUsed)