diff options
author | Leticia Valladares <leticia.valladares.fernandez@qt.io> | 2022-06-29 11:08:45 +0200 |
---|---|---|
committer | Leticia Valladares <leticia.valladares.fernandez@qt.io> | 2022-07-14 14:05:23 +0200 |
commit | c67f129cc3b3c3d0593bb3d1da84fec74f559ddd (patch) | |
tree | 0f11fb407c9fbca5dae778e8beb6c583d7640502 /src/qmldom/qqmldomcomments_p.h | |
parent | 23383528d41a73cb5c1a889a191849480722518b (diff) |
QQmlJS::Dom: Use std::make_shared
Use std::make_shared<T>() over shared_ptr(new T) to perform a single
memory allocation.
Fixes: QTBUG-103948
Change-Id: I8a3a89f20265052ea80c1d68bb1247324e961f8f
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmldom/qqmldomcomments_p.h')
-rw-r--r-- | src/qmldom/qqmldomcomments_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qmldom/qqmldomcomments_p.h b/src/qmldom/qqmldomcomments_p.h index fe7638913a..dd9de347fe 100644 --- a/src/qmldom/qqmldomcomments_p.h +++ b/src/qmldom/qqmldomcomments_p.h @@ -172,7 +172,7 @@ class QMLDOM_EXPORT AstComments final : public OwningItem protected: std::shared_ptr<OwningItem> doCopy(DomItem &) const override { - return std::shared_ptr<OwningItem>(new AstComments(*this)); + return std::make_shared<AstComments>(*this); } public: |