diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-01-20 21:21:13 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-02-14 08:13:21 +0000 |
commit | 0d0812db550834b8935d26cc55f6a155ce6ba65c (patch) | |
tree | 88ffa609aebe6aa7e83a75bec14ffbcc9e86104a | |
parent | eff19ed799c37f3122aca510e2469f4e8fbe1a46 (diff) |
QDateTime: avoid relocations
The short month names all have length 3, so store them in a multi-
dimensional const char array instead of as a pointer table.
Effects on Linux GCC 4.9 stripped release builds:
text -196B
data -64B
relocs -12 (est., somehow relinfo.pl reports nonsense on QtCore)
Change-Id: If5f83e4f1eb5ba0b0f54b4144abec8b88fb8529f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
-rw-r--r-- | src/corelib/tools/qdatetime.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 419826055c..32014320ba 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -155,7 +155,7 @@ static void getDateFromJulianDay(qint64 julianDay, int *yearp, int *monthp, int static const char monthDays[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; #ifndef QT_NO_TEXTDATE -static const char * const qt_shortMonthNames[] = { +static const char qt_shortMonthNames[][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; |