summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-07-30 09:36:04 +0300
committerMarc Mutz <marc.mutz@kdab.com>2016-08-01 16:07:16 +0000
commitd38f86e50b01c6dd60f5a97355031e08d6a47d18 (patch)
tree13dcdf647e32a9828c831bb84e22d74fc0c24242 /src
parent49c892328223dfa2502b462d8e5e8e181f4f6cd5 (diff)
QColor: remove 158 avoidable relocations
Instead of storing a pointer to a string, store the string in the RGBData struct. It's not as efficient as in other such cases, because one string is particularly long, but it's still more than acceptable. Text size increases slightly, but data size decreases a lot (can't say by how much, exactly, as I'm on a UBSan build). Change-Id: I1df2985fd1ebfccd84b48315d8d319dd9e25c8e7 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qcolor_p.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qcolor_p.cpp b/src/gui/painting/qcolor_p.cpp
index b63c34aab7..2b9ef6030e 100644
--- a/src/gui/painting/qcolor_p.cpp
+++ b/src/gui/painting/qcolor_p.cpp
@@ -130,7 +130,7 @@ bool qt_get_hex_rgb(const QChar *str, int len, QRgb *rgb)
#define rgb(r,g,b) (0xff000000 | (r << 16) | (g << 8) | b)
static const struct RGBData {
- const char *name;
+ const char name[21];
uint value;
} rgbTbl[] = {
{ "aliceblue", rgb(240, 248, 255) },