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>
This commit is contained in:
Marc Mutz 2016-07-30 09:36:04 +03:00
parent 49c8923282
commit d38f86e50b

View File

@ -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) },