summaryrefslogtreecommitdiff
path: root/src/protocols/GlobalShortcuts.cpp
diff options
context:
space:
mode:
authorTom Englund <tomenglund26@gmail.com>2024-08-26 20:24:30 +0200
committerGitHub <noreply@github.com>2024-08-26 20:24:30 +0200
commit72c7818ae66a18d126e2b4245d649fe3a93d3b8e (patch)
tree194361ee0d4f92eea809b7904d39f02793c55e13 /src/protocols/GlobalShortcuts.cpp
parent1ea47950f4262ec1215087948c7275f8e0115af2 (diff)
misc: constify the remaining for loops (#7534)
now we roll loops at blazing constified speed.
Diffstat (limited to 'src/protocols/GlobalShortcuts.cpp')
-rw-r--r--src/protocols/GlobalShortcuts.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/protocols/GlobalShortcuts.cpp b/src/protocols/GlobalShortcuts.cpp
index 92bfbae4..b02126ef 100644
--- a/src/protocols/GlobalShortcuts.cpp
+++ b/src/protocols/GlobalShortcuts.cpp
@@ -54,8 +54,8 @@ void CGlobalShortcutsProtocol::destroyResource(CShortcutClient* client) {
}
bool CGlobalShortcutsProtocol::isTaken(std::string appid, std::string trigger) {
- for (auto& c : m_vClients) {
- for (auto& sh : c->shortcuts) {
+ for (auto const& c : m_vClients) {
+ for (auto const& sh : c->shortcuts) {
if (sh->appid == appid && sh->id == trigger) {
return true;
}
@@ -66,8 +66,8 @@ bool CGlobalShortcutsProtocol::isTaken(std::string appid, std::string trigger) {
}
void CGlobalShortcutsProtocol::sendGlobalShortcutEvent(std::string appid, std::string trigger, bool pressed) {
- for (auto& c : m_vClients) {
- for (auto& sh : c->shortcuts) {
+ for (auto const& c : m_vClients) {
+ for (auto const& sh : c->shortcuts) {
if (sh->appid == appid && sh->id == trigger) {
timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
@@ -84,8 +84,8 @@ void CGlobalShortcutsProtocol::sendGlobalShortcutEvent(std::string appid, std::s
std::vector<SShortcut> CGlobalShortcutsProtocol::getAllShortcuts() {
std::vector<SShortcut> copy;
- for (auto& c : m_vClients) {
- for (auto& sh : c->shortcuts) {
+ for (auto const& c : m_vClients) {
+ for (auto const& sh : c->shortcuts) {
copy.push_back(*sh);
}
}