mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 17:00:19 +02:00
Fixes some instances of auto usage with unintentional copy
Just switch the uses over to `const auto&`
This commit is contained in:
7 files changed
+7
-7
No files matched your search
@@ -338,7 +338,7 @@ bool AOTIRCaptureCache::PostCompileCode(FEXCore::Core::InternalThreadState* Thre
|
||||
|
||||
auto LocalRIP = GuestRIP - AOTIRCacheEntry.VAFileStart;
|
||||
auto LocalStartAddr = StartAddr - AOTIRCacheEntry.VAFileStart;
|
||||
auto FileId = AOTIRCacheEntry.Entry->FileId;
|
||||
const auto& FileId = AOTIRCacheEntry.Entry->FileId;
|
||||
|
||||
// The lambda is converted to std::function. This is tricky to refactor so it doesn't allocate memory through glibc.
|
||||
// NOTE: unique_ptr must be passed as a raw pointer since std::function requires lambda captures to be copyable
|
||||
|
||||
@@ -27,7 +27,7 @@ private:
|
||||
};
|
||||
|
||||
IRDumper::IRDumper() {
|
||||
const auto DumpIRStr = DumpIR();
|
||||
const auto& DumpIRStr = DumpIR();
|
||||
if (DumpIRStr == "stderr" || DumpIRStr == "stdout" || DumpIRStr == "no") {
|
||||
// Intentionally do nothing
|
||||
} else if (DumpIRStr == "server") {
|
||||
|
||||
@@ -45,7 +45,7 @@ void Initialize() {
|
||||
return;
|
||||
}
|
||||
|
||||
auto DataDirectory = Config::GetTelemetryDirectory();
|
||||
const auto& DataDirectory = Config::GetTelemetryDirectory();
|
||||
|
||||
// Ensure the folder structure is created for our configuration
|
||||
if (!FHU::Filesystem::Exists(DataDirectory) && !FHU::Filesystem::CreateDirectories(DataDirectory)) {
|
||||
|
||||
@@ -291,7 +291,7 @@ static bool TestInstructions(FEXCore::Context::Context* CTX, FEXCore::Core::Inte
|
||||
bool ShouldShowCode = INSTStats->first.HostCodeInstructions != CurrentTest->ExpectedInstructionCount;
|
||||
|
||||
if (ShouldShowCode) {
|
||||
for (auto Line : INSTStats->second) {
|
||||
for (const auto& Line : INSTStats->second) {
|
||||
LogMan::Msg::EFmt("\t{}", Line);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ int main(int argc, char** argv, char** const envp) {
|
||||
LogMan::Throw::UnInstallHandler();
|
||||
LogMan::Msg::UnInstallHandler();
|
||||
} else {
|
||||
auto LogFile = OutputLog();
|
||||
const auto& LogFile = OutputLog();
|
||||
// If stderr or stdout then we need to dup the FD
|
||||
// In some cases some applications will close stderr and stdout
|
||||
// then redirect the FD to either a log OR some cases just not use
|
||||
|
||||
@@ -96,7 +96,7 @@ void ParseArguments(int argc, char** argv) {
|
||||
}
|
||||
|
||||
if (Options.is_set_by_user("force_ui")) {
|
||||
auto Option = Options["force_ui"];
|
||||
const auto& Option = Options["force_ui"];
|
||||
if (Option == "tty") {
|
||||
UIOption = UIOverrideOption::TTY;
|
||||
} else if (Option == "zenity") {
|
||||
|
||||
@@ -263,7 +263,7 @@ FileManager::FileManager(FEXCore::Context::Context* ctx)
|
||||
}
|
||||
|
||||
// Now that we loaded the thunks object, walk through and ensure dependencies are enabled as well
|
||||
auto ThunkGuestPath = Is64BitMode() ? ThunkGuestLibs() : ThunkGuestLibs32();
|
||||
const auto& ThunkGuestPath = Is64BitMode() ? ThunkGuestLibs() : ThunkGuestLibs32();
|
||||
for (const auto& DBObject : ThunkDB) {
|
||||
if (!DBObject.second.Enabled) {
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user