QStringBuilderCommon: drop const from resolved() result type

The const qualification prevented toUpper() etc from
calling the rvalue overloads of the corresponding QString
functions. Since resolved() always returns a non-shared
object, the rvalue overloads can re-use the object's
capacity for storing their result, saving up to one memory
allocation per QStringBuilderCommon::to*() invocation.

Change-Id: Ica97fcd906cdd949ffe56055654578b93407e2d3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2016-07-08 10:45:51 +02:00
parent e27c07389b
commit 8cee6864c6

View File

@ -76,7 +76,7 @@ struct QStringBuilderCommon
T toLower() const { return resolved().toLower(); }
protected:
const T resolved() const { return *static_cast<const Builder*>(this); }
T resolved() const { return *static_cast<const Builder*>(this); }
};
template<typename Builder, typename T>