Merge pull request #3614 from Sonicadvance1/remove_temporary_allocation

FEXServer: Removes temporary variable allocation
This commit is contained in:
Ryan Houdek 2024-05-07 22:35:23 -07:00 committed by GitHub
commit cd249e2c3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -338,7 +338,7 @@ void HandleSocketData(int Socket) {
break;
}
case FEXServerClient::PacketType::TYPE_GET_ROOTFS_PATH: {
fextl::string MountFolder = SquashFS::GetMountFolder();
const fextl::string& MountFolder = SquashFS::GetMountFolder();
FEXServerClient::FEXServerResultPacket Res {
.MountPath {
@ -357,7 +357,7 @@ void HandleSocketData(int Socket) {
.iov_len = sizeof(Res),
},
{
.iov_base = MountFolder.data(),
.iov_base = const_cast<char*>(MountFolder.data()),
.iov_len = MountFolder.size(),
},
{

View File

@ -265,7 +265,7 @@ bool InitializeSquashFS() {
return true;
}
fextl::string GetMountFolder() {
const fextl::string& GetMountFolder() {
return MountFolder;
}
} // namespace SquashFS

View File

@ -5,5 +5,5 @@
namespace SquashFS {
bool InitializeSquashFS();
void UnmountRootFS();
fextl::string GetMountFolder();
const fextl::string& GetMountFolder();
} // namespace SquashFS