summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qscopedpointer.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-02-01 01:59:54 +0100
committerMarc Mutz <marc.mutz@kdab.com>2015-02-12 09:58:17 +0000
commit08ab00e749c34ec9eae586f9739e0a5d62fc96a9 (patch)
tree50b1597dad7da87e03076ab25f0c435c55f1fb06 /src/corelib/tools/qscopedpointer.h
parent10d3f603f0585926807d63639caa6121ed643e96 (diff)
QString: optimize number() and setNum()
Previously, number() was implemented in terms of setNum(). That makes no sense whatsoever. It creates a temporary value which requires the function to have an exception table and an unwinding trampoline. It also introduces a default constructor (in number()) and a copy assignment (in setNum()), which breaks the chain of RVOs originating in the QLocaleData functions. Instead, implement setNum() in terms of number(). This makes setNum() such a premature pessimisation that it's probably best to deprecate it in the near future. There are not many users of it in qtbase left, and it just pollutes the QString interface. Effects on Linux GCC 4.9 stripped release builds: text -708B data +-0B relocs +-0 Change-Id: I015c9ddb1ba9c98c2c55e38e54ef7894954ac4ca Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/corelib/tools/qscopedpointer.h')
0 files changed, 0 insertions, 0 deletions