From d38f86e50b01c6dd60f5a97355031e08d6a47d18 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 30 Jul 2016 09:36:04 +0300 Subject: 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 --- src/gui/painting/qcolor_p.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) }, -- cgit v1.2.3