Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Menu.php #233

Open
wants to merge 4 commits into
base: 2.34.x
Choose a base branch
from
Open

Update Menu.php #233

wants to merge 4 commits into from

Conversation

tarcisiocms
Copy link

The consumption of the findActive function may be conditioned on the $onlyActive variable since the use of the $foundPage and $foundDepth variables within foreach is also.

In applications with many pages, if you do not use the onlyActive option, the return time can be optimized by conditioning the findActive method call

Q A
Documentation no
Bugfix no
BC Break no
New Feature no
RFC yes
QA no

Description

The consumption of the findActive function may be conditioned on the $onlyActive variable since the use of the $foundPage and $foundDepth variables within foreach is also

Signed-off-by: Tarcisio Cesar <[email protected]>
Correcting indentation

Signed-off-by: Tarcisio Cesar <[email protected]>
Signed-off-by: Tarcisio Cesar <[email protected]>
Signed-off-by: Tarcisio Cesar <[email protected]>
Comment on lines +279 to 286
if ($onlyActive) {
// find deepest active
$found = $this->findActive($container, $minDepth, $maxDepth);
if ($found) {
$foundPage = $found['page'];
$foundDepth = $found['depth'];
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do add a test to verify these changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants