diff options
author | Jędrzej Nowacki <jedrzej.nowacki@digia.com> | 2012-12-13 15:11:21 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-12-14 14:24:44 +0100 |
commit | c09b940a64df421a05b3471af4218a4c320cf6e8 (patch) | |
tree | d3b7bf9319b980f44d3a756ef8b754ba64d59113 /qmljs_engine.cpp | |
parent | 9de4ccef6b14e908f9d3d967f45dca89858772c8 (diff) |
Micro optimization of StringPool
In destructor we do not need to create a copy off all pointers.
By hiding StringPool::strings in class private
section we reduce risk of it being accidentally copied.
Change-Id: I1b9df6bf9e49bd6926e84b8eac6b3d904277e50a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'qmljs_engine.cpp')
-rw-r--r-- | qmljs_engine.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/qmljs_engine.cpp b/qmljs_engine.cpp index 1940a4fa90..78fd64bf7b 100644 --- a/qmljs_engine.cpp +++ b/qmljs_engine.cpp @@ -46,12 +46,14 @@ namespace QQmlJS { namespace VM { -struct StringPool +class StringPool { QHash<QString, String*> strings; - +public: ~StringPool() - { qDeleteAll(strings.values()); } + { + qDeleteAll(strings); + } String *newString(const QString &s) { |