Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Increase readability #741

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Increase readability #741

wants to merge 18 commits into from

Conversation

rotelok
Copy link
Contributor

@rotelok rotelok commented Jun 17, 2018

I spread a few refactors in small commits so you could cherry-pick the ones you like
most commits are just of one of three categories.

  1. increasing readability
  2. compatibility and future proofing
  3. performance

It seems like a lot of changes, but it's not, it's just small corrections on many files, functionality wise everything should be the same, I made an effort to use equivalent constructs every time I made a change, so input/output of the functions shouldn't change

( reverting commit 6ed2edb to fix errors )

rotelok added 18 commits June 16, 2018 00:40
it's equivalent and easier to read this constant was introduced
in php version 5.3.
if (array_search() === FALSE)
to
if (in_array())
substr($var, 0, 1) === $char
to
strpos($var, $char) === 0
and (float)$var, it's faster and more future proof
for ($i=0;$i<count($var);$i++)
to
for ($i=0, $iMax = count($var); $i< $iMax; $i++)

so we don't spend processor time counting the same variable every loop
iteration
the commit had unintende consequences ( broke the file manager, probably
more stuff )
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant