diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 7 | ||||
-rw-r--r-- | src/script/bridge/qscriptqobject.cpp | 3 |
2 files changed, 4 insertions, 6 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(); diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp index d45a6d8..34e6504 100644 --- a/src/script/bridge/qscriptqobject.cpp +++ b/src/script/bridge/qscriptqobject.cpp @@ -2022,8 +2022,7 @@ void QObjectConnectionManager::execute(int slotIndex, void **argv) int argc = parameterTypes.count(); JSC::ExecState *exec = engine->currentFrame; - QVector<JSC::JSValue> argsVector; - argsVector.resize(argc); + QVarLengthArray<JSC::JSValue, 8> argsVector(argc); for (int i = 0; i < argc; ++i) { // ### optimize -- no need to convert via QScriptValue QScriptValue actual; |