mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-25 08:53:48 -07:00
misc: constify the remaining for loops (#7534)
now we roll loops at blazing constified speed.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user