misc: constify the remaining for loops (#7534)
now we roll loops at blazing constified speed.
This commit is contained in:
parent
1ea47950f4
commit
72c7818ae6
79 changed files with 472 additions and 472 deletions
|
|
@ -241,7 +241,7 @@ void CWLSurfaceResource::frame(timespec* now) {
|
|||
if (callbacks.empty())
|
||||
return;
|
||||
|
||||
for (auto& c : callbacks) {
|
||||
for (auto const& c : callbacks) {
|
||||
c->send(now);
|
||||
}
|
||||
|
||||
|
|
@ -257,7 +257,7 @@ void CWLSurfaceResource::bfHelper(std::vector<SP<CWLSurfaceResource>> nodes, std
|
|||
std::vector<SP<CWLSurfaceResource>> nodes2;
|
||||
|
||||
// first, gather all nodes below
|
||||
for (auto& n : nodes) {
|
||||
for (auto const& n : nodes) {
|
||||
std::erase_if(n->subsurfaces, [](const auto& e) { return e.expired(); });
|
||||
// subsurfaces is sorted lowest -> highest
|
||||
for (auto const& c : n->subsurfaces) {
|
||||
|
|
@ -310,7 +310,7 @@ std::pair<SP<CWLSurfaceResource>, Vector2D> CWLSurfaceResource::at(const Vector2
|
|||
void* data) { ((std::vector<std::pair<SP<CWLSurfaceResource>, Vector2D>>*)data)->emplace_back(std::make_pair<>(surf, offset)); },
|
||||
&surfs);
|
||||
|
||||
for (auto& [surf, pos] : surfs | std::views::reverse) {
|
||||
for (auto const& [surf, pos] : surfs | std::views::reverse) {
|
||||
if (!allowsInput) {
|
||||
const auto BOX = CBox{pos, surf->current.size};
|
||||
if (BOX.containsPoint(localCoords))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue