impr: Less unnecessary copying

This commit is contained in:
WerWolv 2025-10-17 23:23:48 +02:00
parent 8d4415fe15
commit 59f9da59e2
2 changed files with 20 additions and 20 deletions

View File

@ -336,7 +336,7 @@ namespace hex::magic {
if (pattern->matches(bytes)) {
foundCorrectType = true;
magicOffset = *address;
magicOffset = address;
}
}
}

View File

@ -899,7 +899,7 @@ namespace hex::plugin::builtin {
}
ImGui::NewLine();
const std::array<std::string, 10> InputTypes = {
constexpr static std::array InputTypes = {
"hex.ui.common.type.u8"_lang,
"hex.ui.common.type.u16"_lang,
"hex.ui.common.type.u32"_lang,
@ -912,11 +912,11 @@ namespace hex::plugin::builtin {
"hex.ui.common.type.f64"_lang
};
if (ImGui::BeginCombo("hex.ui.common.type"_lang, InputTypes[std::to_underlying(settings.type)].c_str())) {
if (ImGui::BeginCombo("hex.ui.common.type"_lang, InputTypes[std::to_underlying(settings.type)].get())) {
for (size_t i = 0; i < InputTypes.size(); i++) {
auto type = static_cast<SearchSettings::Value::Type>(i);
if (ImGui::Selectable(InputTypes[i].c_str(), type == settings.type)) {
if (ImGui::Selectable(InputTypes[i].get(), type == settings.type)) {
settings.type = type;
edited = true;
}