mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-10-02 16:18:31 +00:00
core: make most for loops use const references (#7527)
why not let the compiler optimise things for us at hyprspeeds when we can.
This commit is contained in:
@@ -14,7 +14,7 @@ static void unfocusTool(SP<CTabletTool> tool) {
|
||||
tool->setSurface(nullptr);
|
||||
if (tool->isDown)
|
||||
PROTO::tablet->up(tool);
|
||||
for (auto& b : tool->buttonsDown) {
|
||||
for (auto const& b : tool->buttonsDown) {
|
||||
PROTO::tablet->buttonTool(tool, b, false);
|
||||
}
|
||||
PROTO::tablet->proximityOut(tool);
|
||||
@@ -31,7 +31,7 @@ static void focusTool(SP<CTabletTool> tool, SP<CTablet> tablet, SP<CWLSurfaceRes
|
||||
PROTO::tablet->proximityIn(tool, tablet, surf);
|
||||
if (tool->isDown)
|
||||
PROTO::tablet->down(tool);
|
||||
for (auto& b : tool->buttonsDown) {
|
||||
for (auto const& b : tool->buttonsDown) {
|
||||
PROTO::tablet->buttonTool(tool, b, true);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user