Task #55445

Use array access instead of strpos($str, n, 1)

Added by Michiel Roos over 1 year ago. Updated over 1 year ago.

Status:Resolved Start date:2014-01-29
Priority:Should have Due date:
Assigned To:- % Done:

100%

Category:- Spent time: -
Target version:6.2.0
TYPO3 Version:6.2 Complexity:no-brainer
PHP Version:5.3 Sprint Focus:

Description

A call to strpos can be avoided in case the 'count' parameter is 1.

Use:
$str{n}

Instead of:
strpos($str, n, 1)


Related issues

blocks Core - Task #54517: Replace substr() and strpos() with GeneralUtility::isFirs... Accepted 2013-12-19

Associated revisions

Revision 93cff7e1
Added by Michiel Roos over 1 year ago

[TASK] Use $x[n] instead of substr($x, n, 1)

Change-Id: Ib58894a67f0292b9d62da81511ce12d3f16590ef
Resolves: #55445
Releases: 6.2
Reviewed-on: https://review.typo3.org/27136
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind

History

#1 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27136

#2 Updated by Michiel Roos over 1 year ago

Oops, I wrote strpos instead of substr . . . please correct.

#3 Updated by Michiel Roos over 1 year ago

Reduces call count to substr by 4.289 calls for a page like: http://6.2.master.workbench.local/examples/images-with-links/. From the introduction package.

#4 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27136

#5 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27136

#6 Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27136

#7 Updated by Gerrit Code Review over 1 year ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27136

#8 Updated by Gerrit Code Review over 1 year ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27136

#9 Updated by Gerrit Code Review over 1 year ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27136

#10 Updated by Michiel Roos over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF