From acf83d0b240bdf534b32a04cedd36b0e9d0250ab Mon Sep 17 00:00:00 2001 From: scribam Date: Mon, 1 Jan 2024 16:20:17 +0100 Subject: [PATCH] bm: use const reference/structured bindings with blkmap --- core/hw/sh4/dyna/blockmanager.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/hw/sh4/dyna/blockmanager.cpp b/core/hw/sh4/dyna/blockmanager.cpp index eb33e0e624..62c0636bdb 100644 --- a/core/hw/sh4/dyna/blockmanager.cpp +++ b/core/hw/sh4/dyna/blockmanager.cpp @@ -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()); @@ -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); } } @@ -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());