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

Suboptimal process of process pages id #671

Closed
zeleznypa opened this issue Jun 8, 2023 · 4 comments
Closed

Suboptimal process of process pages id #671

zeleznypa opened this issue Jun 8, 2023 · 4 comments

Comments

@zeleznypa
Copy link

zeleznypa commented Jun 8, 2023

The content folder (.../content) and extension (.md) is fixed for every pages, so it is not necessary to count the string length of the extension for every page.

Pico/lib/Pico.php

Line 1739 in 09aa825

$id = substr($file, strlen($contentDir), -strlen($contentExt));

It will be better to count it once before the foreach and use the result everytime ...

$contentDirLen = strlen($contentDir);
$contentExtLen = strlen($contentExt);

foreach ($files as $i => $file) {
   // ...
   $id = substr($file, $contentDirLen, -$contentExtLen);
@github-actions

This comment was marked as off-topic.

@github-actions

This comment was marked as outdated.

@PhrozenByte
Copy link
Collaborator

Interested in opening a PR against the pico-3.0 branch?

@github-actions
Copy link

github-actions bot commented Jul 1, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! 👍

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

No branches or pull requests

2 participants