summaryrefslogtreecommitdiffstats
path: root/src/script/api
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-08-24 11:07:11 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-08-24 11:09:50 (GMT)
commit293fc4d4b4eb4caa5f50efe23252fe7d93b28df4 (patch)
tree5aace719430a8891e422d974328d1e8af3973189 /src/script/api
parent05254db72eaba7e3394f2c788b259ec29a26d640 (diff)
downloadQt-293fc4d4b4eb4caa5f50efe23252fe7d93b28df4.zip
Qt-293fc4d4b4eb4caa5f50efe23252fe7d93b28df4.tar.gz
Qt-293fc4d4b4eb4caa5f50efe23252fe7d93b28df4.tar.bz2
use QVarLengthArray instead of QVector for holding JS arguments
It's faster. Reviewed-by: Olivier Goffart
Diffstat (limited to 'src/script/api')
-rw-r--r--src/script/api/qscriptvalue.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index 93d6be8..922b068 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -63,6 +63,7 @@
#include <QtCore/qdatetime.h>
#include <QtCore/qregexp.h>
#include <QtCore/qvariant.h>
+#include <QtCore/qvarlengtharray.h>
#include <QtCore/qnumeric.h>
#include "utils/qscriptdate_p.h"
@@ -1943,8 +1944,7 @@ QScriptValue QScriptValue::call(const QScriptValue &thisObject,
if (!jscThisObject || !jscThisObject.isObject())
jscThisObject = d->engine->globalObject();
- QVector<JSC::JSValue> argsVector;
- argsVector.resize(args.size());
+ QVarLengthArray<JSC::JSValue, 8> argsVector(args.size());
for (int i = 0; i < args.size(); ++i) {
const QScriptValue &arg = args.at(i);
if (!arg.isValid()) {
@@ -2077,8 +2077,7 @@ QScriptValue QScriptValue::construct(const QScriptValueList &args)
return QScriptValue();
JSC::ExecState *exec = d->engine->currentFrame;
- QVector<JSC::JSValue> argsVector;
- argsVector.resize(args.size());
+ QVarLengthArray<JSC::JSValue, 8> argsVector(args.size());
for (int i = 0; i < args.size(); ++i) {
if (!args.at(i).isValid())
argsVector[i] = JSC::jsUndefined();