Skip to content

Commit

Permalink
refactor: removed unnecessary usages of Memory::Read and Memory::Write
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementDreptin committed Sep 1, 2023
1 parent c400bff commit efbb5c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Detour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void Detour::DetourFunctionStart()

for (size_t i = 0; i < NUM_INSTRUCTIONS_IN_JUMP; i++)
{
POWERPC_INSTRUCTION instruction = Memory::Read<POWERPC_INSTRUCTION>(&pSource[i]);
POWERPC_INSTRUCTION instruction = pSource[i];
POWERPC_INSTRUCTION_TYPE instructionType = Memory::Read<POWERPC_INSTRUCTION_TYPE>(&pSource[i]);

// If the function op code is null, it's invalid
Expand Down Expand Up @@ -116,7 +116,7 @@ void Detour::DetourFunctionStart()
// Otherwise, just copy the instruction to the stub
else
{
Memory::Write<POWERPC_INSTRUCTION>(&pStub[instructionCount], instruction);
pStub[instructionCount] = instruction;
instructionCount++;
}
}
Expand Down

0 comments on commit efbb5c3

Please sign in to comment.