add some performance optimizations by utilizing MoveTemp in return statements
This commit is contained in:
@@ -84,8 +84,8 @@ void FSGDeviceImpl::ParseFirmware(const FString& RawFirmware, int32& OutMainVers
|
||||
|
||||
FString FSGDeviceImpl::ToString(ESGDeviceType DeviceType)
|
||||
{
|
||||
const FString String{UTF8_TO_TCHAR(FSGDeviceType::ToString(FSGCoreEnumCast::ToEDeviceType(DeviceType)).c_str())};
|
||||
return String;
|
||||
FString String{UTF8_TO_TCHAR(FSGDeviceType::ToString(FSGCoreEnumCast::ToEDeviceType(DeviceType)).c_str())};
|
||||
return MoveTemp(String);
|
||||
}
|
||||
|
||||
FSGDeviceImpl::FSGDeviceImpl()
|
||||
@@ -192,14 +192,14 @@ int32 FSGDeviceImpl::GetSubFirmwareVersion() const
|
||||
|
||||
FString FSGDeviceImpl::GetFirmwareString() const
|
||||
{
|
||||
const FString String{UTF8_TO_TCHAR(ToSGDevicePtrChecked()->GetFirmwareString().c_str())};
|
||||
return String;
|
||||
FString String{UTF8_TO_TCHAR(ToSGDevicePtrChecked()->GetFirmwareString().c_str())};
|
||||
return MoveTemp(String);
|
||||
}
|
||||
|
||||
FString FSGDeviceImpl::GetAddress() const
|
||||
{
|
||||
const FString String(UTF8_TO_TCHAR(ToSGDevicePtrChecked()->GetAddress().c_str()));
|
||||
return String;
|
||||
FString String(UTF8_TO_TCHAR(ToSGDevicePtrChecked()->GetAddress().c_str()));
|
||||
return MoveTemp(String);
|
||||
}
|
||||
|
||||
bool FSGDeviceImpl::IsConnected() const
|
||||
@@ -254,8 +254,8 @@ bool FSGDeviceImpl::GetBatteryLevel(float& OutLevel)
|
||||
|
||||
FString FSGDeviceImpl::ToString() const
|
||||
{
|
||||
const FString String(UTF8_TO_TCHAR(ToSGDevicePtrChecked()->ToString().c_str()));
|
||||
return String;
|
||||
FString String(UTF8_TO_TCHAR(ToSGDevicePtrChecked()->ToString().c_str()));
|
||||
return MoveTemp(String);
|
||||
}
|
||||
|
||||
FSGDeviceImpl::FImpl::FImpl(FSGDeviceImpl* InOwner)
|
||||
|
||||
Reference in New Issue
Block a user