GCC: Remedy NRVO Fails

Using the `-Wnrvo` flag introduced by GCC 14, I identified a few places where NRVO was clearly intended, but is fumbled.
This commit is contained in:
mitaclaw
2024-12-13 14:02:12 -08:00
parent 87496205aa
commit 433c6ce0f2
6 changed files with 11 additions and 17 deletions

View File

@ -183,14 +183,11 @@ TextureInfo::NameDetails TextureInfo::CalculateTextureName() const
const u64 tex_hash = XXH64(m_ptr, m_texture_size, 0);
const u64 tlut_hash = tlut_size ? XXH64(tlut, tlut_size, 0) : 0;
NameDetails result;
result.base_name = fmt::format("{}{}x{}{}", format_prefix, m_raw_width, m_raw_height,
m_mipmaps_enabled ? "_m" : "");
result.texture_name = fmt::format("{:016x}", tex_hash);
result.tlut_name = tlut_size ? fmt::format("_{:016x}", tlut_hash) : "";
result.format_name = fmt::to_string(static_cast<int>(m_texture_format));
return result;
return {.base_name = fmt::format("{}{}x{}{}", format_prefix, m_raw_width, m_raw_height,
m_mipmaps_enabled ? "_m" : ""),
.texture_name = fmt::format("{:016x}", tex_hash),
.tlut_name = tlut_size ? fmt::format("_{:016x}", tlut_hash) : "",
.format_name = fmt::to_string(static_cast<int>(m_texture_format))};
}
bool TextureInfo::IsDataValid() const