Skip to content

Commit

Permalink
bm: use const reference/structured bindings with blkmap
Browse files Browse the repository at this point in the history
  • Loading branch information
scribam committed Jan 1, 2024
1 parent e5fc182 commit acf83d0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions core/hw/sh4/dyna/blockmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,8 @@ void bm_WriteBlockMap(const std::string& file)
if (f)
{
INFO_LOG(DYNAREC, "Writing block map !");
for (auto& it : blkmap)
for (const auto& [_, block] : blkmap)
{
RuntimeBlockInfoPtr& block = it.second;
fprintf(f, "block: %d:%08X:%p:%d:%d:%d\n", block->BlockType, block->addr, block->code, block->host_code_size, block->guest_cycles, block->guest_opcodes);
for(size_t j = 0; j < block->oplist.size(); j++)
fprintf(f,"\top: %zd:%d:%s\n", j, block->oplist[j].guest_offs, block->oplist[j].dissasm().c_str());
Expand All @@ -374,9 +373,8 @@ void bm_WriteBlockMap(const std::string& file)

void sh4_jitsym(FILE* out)
{
for (const auto& it : blkmap)
for (const auto& [_, block] : blkmap)
{
const RuntimeBlockInfoPtr& block = it.second;
fprintf(out, "%p %d %08X\n", block->code, block->host_code_size, block->addr);
}
}
Expand Down Expand Up @@ -548,9 +546,8 @@ void print_blocks()
INFO_LOG(DYNAREC, "Writing blocks to %p", f);
}

for (auto it : blkmap)
for (const auto& [_, blk] : blkmap)
{
RuntimeBlockInfoPtr blk = it.second;
if (f)
{
fprintf(f,"block: %p\n",blk.get());
Expand Down

0 comments on commit acf83d0

Please sign in to comment.