summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-08-24 16:31:32 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-08-24 16:31:32 (GMT)
commit417f383de40748ebe55d282f473d3d5baa8a254e (patch)
tree62fa40962cd36d22607cede47c55dfc1c7cfe9a4 /src
parentec30175915542e3b5c9cff2d807c62ad93d39a54 (diff)
downloadQt-417f383de40748ebe55d282f473d3d5baa8a254e.zip
Qt-417f383de40748ebe55d282f473d3d5baa8a254e.tar.gz
Qt-417f383de40748ebe55d282f473d3d5baa8a254e.tar.bz2
pass engine and identifier to QScriptStringPrivate constructor
Small cleanup/optimization.
Diffstat (limited to 'src')
-rw-r--r--src/script/api/qscriptstring.cpp10
-rw-r--r--src/script/api/qscriptstring_p.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/script/api/qscriptstring.cpp b/src/script/api/qscriptstring.cpp
index b9c26f8..de707e9 100644
--- a/src/script/api/qscriptstring.cpp
+++ b/src/script/api/qscriptstring.cpp
@@ -72,7 +72,8 @@ QT_BEGIN_NAMESPACE
/*!
\internal
*/
-QScriptStringPrivate::QScriptStringPrivate()
+QScriptStringPrivate::QScriptStringPrivate(QScriptEngine *e, const JSC::Identifier &id)
+ : engine(e), identifier(id)
{
ref = 0;
}
@@ -87,12 +88,11 @@ QScriptStringPrivate::~QScriptStringPrivate()
/*!
\internal
*/
-void QScriptStringPrivate::init(QScriptString &q, QScriptEngine *engine, const JSC::Identifier &value)
+void QScriptStringPrivate::init(QScriptString &q, QScriptEngine *engine,
+ const JSC::Identifier &value)
{
Q_ASSERT(!q.isValid());
- q.d_ptr = new QScriptStringPrivate();
- q.d_ptr->identifier = value;
- q.d_ptr->engine = engine;
+ q.d_ptr = new QScriptStringPrivate(engine, value);
}
/*!
diff --git a/src/script/api/qscriptstring_p.h b/src/script/api/qscriptstring_p.h
index 74094bf..3413315 100644
--- a/src/script/api/qscriptstring_p.h
+++ b/src/script/api/qscriptstring_p.h
@@ -69,10 +69,10 @@ class QScriptEngine;
class QScriptStringPrivate
{
public:
- QScriptStringPrivate();
+ QScriptStringPrivate(QScriptEngine *engine, const JSC::Identifier &id);
~QScriptStringPrivate();
- static void init(QScriptString &q, QScriptEngine *engine, const JSC::Identifier &value);
+ static void init(QScriptString &q, QScriptEngine *engine, const JSC::Identifier &id);
QBasicAtomicInt ref;
#ifndef QT_NO_QOBJECT