mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
impr: Small performance improvements
This commit is contained in:
@@ -882,7 +882,7 @@ namespace hex {
|
||||
continue;
|
||||
}
|
||||
|
||||
translationDefinitions.emplace(key, value.get<std::string>());
|
||||
translationDefinitions.emplace(std::move(key), value.get<std::string>());
|
||||
}
|
||||
|
||||
(*impl::s_definitions)[code.get<std::string>()].emplace_back(std::move(translationDefinitions));
|
||||
|
||||
@@ -28,13 +28,10 @@ namespace hex {
|
||||
}
|
||||
|
||||
LanguageDefinition::LanguageDefinition(std::map<std::string, std::string> &&entries) {
|
||||
for (const auto &[key, value] : entries) {
|
||||
if (value.empty())
|
||||
continue;
|
||||
|
||||
m_entries.insert({ key, value });
|
||||
}
|
||||
|
||||
m_entries = std::move(entries);
|
||||
std::erase_if(m_entries, [](const auto &entry) {
|
||||
return entry.second.empty();
|
||||
});
|
||||
}
|
||||
|
||||
const std::map<std::string, std::string> &LanguageDefinition::getEntries() const {
|
||||
|
||||
@@ -446,7 +446,7 @@ namespace ImGuiExt {
|
||||
ImGuiContext &g = *GImGui;
|
||||
const ImGuiStyle &style = g.Style;
|
||||
const ImGuiID id = window->GetID(label);
|
||||
const ImVec2 text_size = CalcTextSize((std::string(label) + "\n " + std::string(description)).c_str(), nullptr, true);
|
||||
const ImVec2 text_size = CalcTextSize(label, nullptr, true) + CalcTextSize(description, nullptr, true);
|
||||
const ImVec2 label_size = CalcTextSize(label, nullptr, true);
|
||||
|
||||
ImVec2 pos = window->DC.CursorPos;
|
||||
|
||||
Reference in New Issue
Block a user