Skip to content
Snippets Groups Projects
Commit de27a20a authored by Markus Klein's avatar Markus Klein Committed by Stefan Neufeind
Browse files

[CLEANUP] Replace strlen() with === for zero length check

It is faster to compare a string with === '' to find out if it's empty
than to run strlen() on it.

The replacement rules are applied as follows:
 *    if (strlen($str))
   => if ((string)$str !== '')
 *    if (!is_string($str) || strlen($str) === 0)
   => if (!is_string($str) || $str === '')
 * If it can be seen easily that $str is a string,
   the typecast is omitted.

Resolves: #54091
Releases: 6.2
Change-Id: I59c5cbccea4f98b8f282377e6aa67d970859a457
Reviewed-on: https://review.typo3.org/27091
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
parent 0c5a0aa1
Branches
Tags
No related merge requests found
Showing
with 61 additions and 56 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment