mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 07:45:33 +01:00
Merge pull request #12526 from lioncash/trace
CodeTrace: Use std::set::lower_bound() over std::lower_bound()
This commit is contained in:
commit
74d4cb0274
@ -53,12 +53,11 @@ u32 GetMemoryTargetSize(std::string_view instr)
|
|||||||
bool CompareMemoryTargetToTracked(const std::string& instr, const u32 mem_target,
|
bool CompareMemoryTargetToTracked(const std::string& instr, const u32 mem_target,
|
||||||
const std::set<u32>& mem_tracked)
|
const std::set<u32>& mem_tracked)
|
||||||
{
|
{
|
||||||
// This function is hit often and should be optimized.
|
const auto it_lower = mem_tracked.lower_bound(mem_target);
|
||||||
auto it_lower = std::lower_bound(mem_tracked.begin(), mem_tracked.end(), mem_target);
|
|
||||||
|
|
||||||
if (it_lower == mem_tracked.end())
|
if (it_lower == mem_tracked.end())
|
||||||
return false;
|
return false;
|
||||||
else if (*it_lower == mem_target)
|
if (*it_lower == mem_target)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// If the base value doesn't hit, still need to check if longer values overlap.
|
// If the base value doesn't hit, still need to check if longer values overlap.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user