QDateTimeParser: use rvalue overloads more
to reuse existing buffer of QString and save some allocations Change-Id: I31810c2fd3f0f70b19c19a530600e8cee5d6631a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
7a8e7213e4
commit
1ba6209909
@ -2303,8 +2303,8 @@ QString QDateTimeParser::getAmPmText(AmPm ap, Case cs) const
|
|||||||
QString raw = ap == AmText ? loc.amText() : loc.pmText();
|
QString raw = ap == AmText ? loc.amText() : loc.pmText();
|
||||||
switch (cs)
|
switch (cs)
|
||||||
{
|
{
|
||||||
case UpperCase: return raw.toUpper();
|
case UpperCase: return std::move(raw).toUpper();
|
||||||
case LowerCase: return raw.toLower();
|
case LowerCase: return std::move(raw).toLower();
|
||||||
case NativeCase: return raw;
|
case NativeCase: return raw;
|
||||||
}
|
}
|
||||||
Q_UNREACHABLE_RETURN(raw);
|
Q_UNREACHABLE_RETURN(raw);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user