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:
parent
9c5a37a797
commit
8d6c18076f
31 changed files with 169 additions and 169 deletions
|
|
@ -260,7 +260,7 @@ void CWLSurfaceResource::bfHelper(std::vector<SP<CWLSurfaceResource>> nodes, std
|
|||
for (auto& n : nodes) {
|
||||
std::erase_if(n->subsurfaces, [](const auto& e) { return e.expired(); });
|
||||
// subsurfaces is sorted lowest -> highest
|
||||
for (auto& c : n->subsurfaces) {
|
||||
for (auto const& c : n->subsurfaces) {
|
||||
if (c->zIndex >= 0)
|
||||
break;
|
||||
if (c->surface.expired())
|
||||
|
|
@ -274,7 +274,7 @@ void CWLSurfaceResource::bfHelper(std::vector<SP<CWLSurfaceResource>> nodes, std
|
|||
|
||||
nodes2.clear();
|
||||
|
||||
for (auto& n : nodes) {
|
||||
for (auto const& n : nodes) {
|
||||
Vector2D offset = {};
|
||||
if (n->role->role() == SURFACE_ROLE_SUBSURFACE) {
|
||||
auto subsurface = ((CSubsurfaceRole*)n->role.get())->subsurface.lock();
|
||||
|
|
@ -284,8 +284,8 @@ void CWLSurfaceResource::bfHelper(std::vector<SP<CWLSurfaceResource>> nodes, std
|
|||
fn(n, offset, data);
|
||||
}
|
||||
|
||||
for (auto& n : nodes) {
|
||||
for (auto& c : n->subsurfaces) {
|
||||
for (auto const& n : nodes) {
|
||||
for (auto const& c : n->subsurfaces) {
|
||||
if (c->zIndex < 0)
|
||||
continue;
|
||||
if (c->surface.expired())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue