Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-14577

Stop using sizeof() inside for() loop

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.8
    • Fix Version/s: 3.1.9-RC1, 3.2.0-RC1
    • Component/s: None
    • Labels:
      None

      Description

      In several places, we calculate the size of the for loop inside the for() declaration. This adds a rather big overhead as the loop size is calculated on every iteration. Especially in larger loops, this will noticeably increase the amount of time spent in for loops. Additionally, this should be actively discouraged in the coding guidelines.

        Attachments

          Activity

            People

            • Assignee:
              Marc Marc
              Reporter:
              Marc Marc
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: