summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorTom Englund <tomenglund26@gmail.com>2024-08-26 17:25:39 +0200
committerGitHub <noreply@github.com>2024-08-26 17:25:39 +0200
commit8d6c18076f3268a6c85c6085d29f898267028101 (patch)
tree9db19e850b0a3e2c5d20d5ca2ad5f9878eca89b1 /src/managers/KeybindManager.cpp
parent9c5a37a797ea1f1829859ab5b07016b2f27f739c (diff)
core: make most for loops use const references (#7527)
why not let the compiler optimise things for us at hyprspeeds when we can.
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 8bf7152e..7eb96730 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -765,7 +765,7 @@ void CKeybindManager::shadowKeybinds(const xkb_keysym_t& doesntHave, const uint3
const auto KBKEY = xkb_keysym_from_name(k.key.c_str(), XKB_KEYSYM_CASE_INSENSITIVE);
const auto KBKEYUPPER = xkb_keysym_to_upper(KBKEY);
- for (auto& pk : m_dPressedKeys) {
+ for (auto const& pk : m_dPressedKeys) {
if ((pk.keysym != 0 && (pk.keysym == KBKEY || pk.keysym == KBKEYUPPER))) {
shadow = true;
@@ -864,7 +864,7 @@ SDispatchResult CKeybindManager::spawn(std::string args) {
if (!RULES.empty()) {
const auto RULESLIST = CVarList(RULES, 0, ';');
- for (auto& r : RULESLIST) {
+ for (auto const& r : RULESLIST) {
g_pConfigManager->addExecRule({r, (unsigned long)PROC});
}
@@ -1708,7 +1708,7 @@ SDispatchResult CKeybindManager::workspaceOpt(std::string args) {
PWORKSPACE->m_bDefaultPseudo = !PWORKSPACE->m_bDefaultPseudo;
// apply
- for (auto& w : g_pCompositor->m_vWindows) {
+ for (auto const& w : g_pCompositor->m_vWindows) {
if (!w->m_bIsMapped || w->m_pWorkspace != PWORKSPACE)
continue;
@@ -2129,7 +2129,7 @@ SDispatchResult CKeybindManager::setSubmap(std::string submap) {
return {};
}
- for (auto& k : g_pKeybindManager->m_lKeybinds) {
+ for (auto const& k : g_pKeybindManager->m_lKeybinds) {
if (k.submap == submap) {
m_szCurrentSelectedSubmap = submap;
Debug::log(LOG, "Changed keybind submap to {}", submap);