Project

General

Profile

Actions

Task #55445

closed

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

Added by Michiel Roos about 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2014-01-29
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
no-brainer
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 1 (0 open1 closed)

Blocks TYPO3 Core - Task #54517: Replace substr() and strpos() with GeneralUtility::isFirstPartOfString when it makes senseRejectedJo Hasenau2013-12-19

Actions
Actions #1

Updated by Gerrit Code Review about 10 years 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

Actions #2

Updated by Michiel Roos about 10 years ago

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

Actions #3

Updated by Michiel Roos about 10 years 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.

Actions #4

Updated by Gerrit Code Review about 10 years 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

Actions #5

Updated by Gerrit Code Review about 10 years 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

Actions #6

Updated by Gerrit Code Review about 10 years 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

Actions #7

Updated by Gerrit Code Review about 10 years 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

Actions #8

Updated by Gerrit Code Review about 10 years 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

Actions #9

Updated by Gerrit Code Review about 10 years 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

Actions #10

Updated by Michiel Roos about 10 years ago

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

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF