summaryrefslogtreecommitdiff
path: root/src/client/qwaylandcursor_p.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-06-05 17:27:10 +0200
committerMarc Mutz <marc.mutz@kdab.com>2020-05-18 16:30:14 +0200
commit35efe87ccc20bd80e60d23d5ec2a9581ad5e32b9 (patch)
treeb78a40219faa63eb0c1d5b0ab49dd7cce42a1bb0 /src/client/qwaylandcursor_p.h
parentdcd0aa6b31623ee6e2ef50a3c5aaef7054f8d6a9 (diff)
downloadqtwayland-35efe87ccc20bd80e60d23d5ec2a9581ad5e32b9.tar.gz
QWaylandDisplay: replace a QMap<pair<QString,int>, pointer*> with a std::vector<{QString, int, unique_ptr}>
The vector is sorted, so lookup performance is the same, or better. Insertion performance is worse, of course, at least in big-O terms, but probably not in practice. But now the good part: saves a stunning 7.2KiB (0.6%) in text size on optimized AMD 64 Linux GCC 9.1 builds. Change-Id: Ie604f83d7d51111430db1d0bb89d8cc3a52301bf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/client/qwaylandcursor_p.h')
-rw-r--r--src/client/qwaylandcursor_p.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/qwaylandcursor_p.h b/src/client/qwaylandcursor_p.h
index 3e5cff9b..de96c22b 100644
--- a/src/client/qwaylandcursor_p.h
+++ b/src/client/qwaylandcursor_p.h
@@ -57,6 +57,8 @@
#if QT_CONFIG(cursor)
+#include <memory>
+
struct wl_cursor;
struct wl_cursor_image;
struct wl_cursor_theme;
@@ -73,7 +75,7 @@ class QWaylandShm;
class Q_WAYLAND_CLIENT_EXPORT QWaylandCursorTheme
{
public:
- static QWaylandCursorTheme *create(QWaylandShm *shm, int size, const QString &themeName);
+ static std::unique_ptr<QWaylandCursorTheme> create(QWaylandShm *shm, int size, const QString &themeName);
~QWaylandCursorTheme();
::wl_cursor *cursor(Qt::CursorShape shape);