QStorageInfo/Linux: move from MountInfo's contents

Copying QStrings and QByteArrays is reasonably cheap, but moving is
cheaper.

Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1787498ead687da2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
This commit is contained in:
Thiago Macieira 2023-09-22 10:44:21 -07:00
parent 914b3bc985
commit da95ad91b3

View File

@ -149,10 +149,10 @@ void QStorageInfoPrivate::initRootPath()
}
}
if (bestInfo) {
rootPath = bestInfo->mountPoint;
device = bestInfo->device;
fileSystemType = bestInfo->fsType;
subvolume = bestInfo->fsRoot;
rootPath = std::move(bestInfo->mountPoint);
device = std::move(bestInfo->device);
fileSystemType = std::move(bestInfo->fsType);
subvolume = std::move(bestInfo->fsRoot);
}
}