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
|
|
@ -49,7 +49,7 @@ void SDwindleNodeData::getAllChildrenRecursive(std::deque<SDwindleNodeData*>* pD
|
|||
|
||||
int CHyprDwindleLayout::getNodesOnWorkspace(const WORKSPACEID& id) {
|
||||
int no = 0;
|
||||
for (auto& n : m_lDwindleNodesData) {
|
||||
for (auto const& n : m_lDwindleNodesData) {
|
||||
if (n.workspaceID == id && n.valid)
|
||||
++no;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -691,7 +691,7 @@ Vector2D IHyprLayout::predictSizeForNewWindow(PHLWINDOW pWindow) {
|
|||
bool shouldBeFloated = g_pXWaylandManager->shouldBeFloated(pWindow, true);
|
||||
|
||||
if (!shouldBeFloated) {
|
||||
for (auto& r : g_pConfigManager->getMatchingRules(pWindow, true, true)) {
|
||||
for (auto const& r : g_pConfigManager->getMatchingRules(pWindow, true, true)) {
|
||||
if (r.szRule.starts_with("float")) {
|
||||
shouldBeFloated = true;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ SMasterNodeData* CHyprMasterLayout::getNodeFromWindow(PHLWINDOW pWindow) {
|
|||
|
||||
int CHyprMasterLayout::getNodesOnWorkspace(const WORKSPACEID& ws) {
|
||||
int no = 0;
|
||||
for (auto& n : m_lMasterNodesData) {
|
||||
for (auto const& n : m_lMasterNodesData) {
|
||||
if (n.workspaceID == ws)
|
||||
no++;
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ int CHyprMasterLayout::getNodesOnWorkspace(const WORKSPACEID& ws) {
|
|||
|
||||
int CHyprMasterLayout::getMastersOnWorkspace(const WORKSPACEID& ws) {
|
||||
int no = 0;
|
||||
for (auto& n : m_lMasterNodesData) {
|
||||
for (auto const& n : m_lMasterNodesData) {
|
||||
if (n.workspaceID == ws && n.isMaster)
|
||||
no++;
|
||||
}
|
||||
|
|
@ -381,7 +381,7 @@ void CHyprMasterLayout::calculateWorkspace(PHLWORKSPACE pWorkspace) {
|
|||
if (*PSMARTRESIZING) {
|
||||
// check the total width and height so that later
|
||||
// if larger/smaller than screen size them down/up
|
||||
for (auto& nd : m_lMasterNodesData) {
|
||||
for (auto const& nd : m_lMasterNodesData) {
|
||||
if (nd.workspaceID == pWorkspace->m_iID) {
|
||||
if (nd.isMaster)
|
||||
masterAccumulatedSize += totalSize / MASTERS * nd.percSize;
|
||||
|
|
@ -552,7 +552,7 @@ void CHyprMasterLayout::calculateWorkspace(PHLWORKSPACE pWorkspace) {
|
|||
float slaveAccumulatedHeightL = 0;
|
||||
float slaveAccumulatedHeightR = 0;
|
||||
if (*PSMARTRESIZING) {
|
||||
for (auto& nd : m_lMasterNodesData) {
|
||||
for (auto const& nd : m_lMasterNodesData) {
|
||||
if (nd.workspaceID != pWorkspace->m_iID || nd.isMaster)
|
||||
continue;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue