QScopedValueRollback: add two strategic qMove()s

Use moves instead of copies when the rhs is no longer needed
afterwards.

Change-Id: If053bfce03b886099688452ada74f6a6f36db5c2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2015-04-16 11:20:42 +02:00
parent fb144aabbf
commit 1ae657344c

View File

@ -50,12 +50,12 @@ public:
explicit QScopedValueRollback(T &var, T value) :
varRef(var), oldValue(var)
{
varRef = value;
varRef = qMove(value);
}
~QScopedValueRollback()
{
varRef = oldValue;
varRef = qMove(oldValue);
}
void commit()