summaryrefslogtreecommitdiffstats
path: root/src/script/bridge/qscriptqobject_p.h
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2010-03-05 11:23:09 (GMT)
committerKent Hansen <kent.hansen@nokia.com>2010-03-05 13:24:22 (GMT)
commit8a9a160c8f509511b7e44b66a20d60fb37d614cc (patch)
treeb7723c1e7ae6aef1a0a71f8dac2c93bbd671104a /src/script/bridge/qscriptqobject_p.h
parent88e9515cc4300d841b16f17fe6b5c8c0d6de3562 (diff)
downloadQt-8a9a160c8f509511b7e44b66a20d60fb37d614cc.zip
Qt-8a9a160c8f509511b7e44b66a20d60fb37d614cc.tar.gz
Qt-8a9a160c8f509511b7e44b66a20d60fb37d614cc.tar.bz2
QtScript: Don't needlessly make deep copies of function names
The QObject binding uses the function name to determine whether a meta-method is an overload. This was implemented quite naively by copying the name from the signature into another array before comparing it. This could cause several unnecessary memory allocations, since storing the name is really only needed when there is an exception (e.g. ambiguous call). Instead, use strncmp to compare only the relevant characters of the original (non-copied) method signature. This makes normal slot invocation from QtScript up to 15% faster. Reviewed-by: Jedrzej Nowacki
Diffstat (limited to 'src/script/bridge/qscriptqobject_p.h')
-rw-r--r--src/script/bridge/qscriptqobject_p.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/script/bridge/qscriptqobject_p.h b/src/script/bridge/qscriptqobject_p.h
index 448fa99..8b05d6b 100644
--- a/src/script/bridge/qscriptqobject_p.h
+++ b/src/script/bridge/qscriptqobject_p.h
@@ -212,7 +212,6 @@ public:
bool maybeOverloaded() const;
int mostGeneralMethod(QMetaMethod *out = 0) const;
QList<int> overloadedIndexes() const;
- QString functionName() const;
private:
Data *data;