dwm: Use m_state_labels.emplace instead of .insert

Looks cleaner.
This commit is contained in:
Mihir Lad 2020-07-29 21:40:14 -04:00
parent fbe05890e0
commit 7e78844a8f

View File

@ -22,16 +22,14 @@ namespace modules {
// Populate m_state_labels map with labels and their states
if (m_formatter->has(TAG_LABEL_TAGS)) {
m_state_labels.insert(
std::make_pair(state_t::FOCUSED, load_optional_label(m_conf, name(), "label-focused", DEFAULT_STATE_LABEL)));
m_state_labels.insert(std::make_pair(
state_t::UNFOCUSED, load_optional_label(m_conf, name(), "label-unfocused", DEFAULT_STATE_LABEL)));
m_state_labels.insert(
std::make_pair(state_t::VISIBLE, load_optional_label(m_conf, name(), "label-visible", DEFAULT_STATE_LABEL)));
m_state_labels.insert(
std::make_pair(state_t::URGENT, load_optional_label(m_conf, name(), "label-urgent", DEFAULT_STATE_LABEL)));
m_state_labels.insert(
std::make_pair(state_t::EMPTY, load_optional_label(m_conf, name(), "label-empty", DEFAULT_STATE_LABEL)));
m_state_labels.emplace(
state_t::FOCUSED, load_optional_label(m_conf, name(), "label-focused", DEFAULT_STATE_LABEL));
m_state_labels.emplace(
state_t::UNFOCUSED, load_optional_label(m_conf, name(), "label-unfocused", DEFAULT_STATE_LABEL));
m_state_labels.emplace(
state_t::VISIBLE, load_optional_label(m_conf, name(), "label-visible", DEFAULT_STATE_LABEL));
m_state_labels.emplace(state_t::URGENT, load_optional_label(m_conf, name(), "label-urgent", DEFAULT_STATE_LABEL));
m_state_labels.emplace(state_t::EMPTY, load_optional_label(m_conf, name(), "label-empty", DEFAULT_STATE_LABEL));
}
m_seperator_label = load_optional_label(m_conf, name(), "label-separator", "");